PHP 8.6.0 Beta 3 is available for testing

Yaf_Controller_Abstract::getRequest

(Yaf >=1.0.0)

Yaf_Controller_Abstract::getRequestRetrieve current request object

Опис

public function Yaf_Controller_Abstract::getRequest(): ?Yaf_Request_Abstract

Returns the Yaf_Request_Abstract instance associated with this controller.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

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

Приклади

Приклад #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());
    }
}
?>

Поданий вище приклад виведе щось схоже на:

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

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top