PHP 8.6.0 Beta 3 is available for testing

Yaf_Dispatcher::getRequest

(Yaf >=1.0.0)

Yaf_Dispatcher::getRequestRetrieve the request instance

Descrizione

public function Yaf_Dispatcher::getRequest(): ?Yaf_Request_Abstract

Retrieve the request object held by the dispatcher.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

The Yaf_Request_Abstract instance, or null if the application is not initialized.

Esempi

Example #1 Yaf_Dispatcher::getRequest() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        $request = Yaf_Dispatcher::getInstance()->getRequest();

        // The dispatcher holds the very same request object that is
        // passed to the controller
        var_dump($request === $this->getRequest());

        return false;
    }
}
?>

Il precedente esempio visualizzerà qualcosa simile a:

bool(true)

Vedere anche:

add a note

User Contributed Notes

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