Yaf_Controller_Abstract::getRequest

(Yaf >=1.0.0)

Yaf_Controller_Abstract::getRequestRetrieve current request object

Description

public function Yaf_Controller_Abstract::getRequest(): ?Yaf_Request_Abstract

Returns the Yaf_Request_Abstract instance associated with this controller.

Parameters

This function has no parameters.

Return Values

A Yaf_Request_Abstract instance, or null if no request is available.

Examples

Example #1 Yaf_Controller_Abstract::getRequest() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction() {
        $request = $this->getRequest();
        var_dump($request->getModuleName());
        var_dump($request->getControllerName());
        var_dump($request->getActionName());
    }
}
?>

The above example will output something similar to:

string(5) "Index"
string(5) "Index"
string(5) "index"

See Also

add a note

User Contributed Notes

There are no user contributed notes for this page.