(this page is translated by Google; We're working hard on a human translation)
Nette\Application\PresenterRequest
Object to encapsulate the requirements specified and subsequently forwarded to the presenter, and methods for handling them.
PresenterRequest object is consistently encapsulated representation of all queries that were received by the browser as a requirement for the page is loaded, and the characteristics and parameters of the current Route, which has been designated as meeting the requirements of the mask.
Specifically, the first phase of the application lifecycle, the router creates a URL object PresenterRequest, which carries the information presenter which will serve the requirement. This object can then keep the application and final presenter.
Modification of the building run the risk of malfunction of your applications!
PresenterRequest object in itself holds, in addition to the above information, as well as information about the data sent using the POST method, for any uploaded files and about how they were processed request (GET, POST, ...).
Those features, of course, has the appropriate method:
// uměle nastavíme proměnné
$_POST = array ( 'a' => 'variable1' , 'b' => 'variable2' , 'c' => 'variable3' )
// pomocí třídy Environment získáme objekt PresenterRequest
$request = Environment::getApplication()->getPresenter()->getRequest();
// byl požadavek vyvolán metodou POST ?
$request ->isMethod( 'post' ); // ekvivalentně $request->isPost();
// získání obsahu globální proměnné $_POST
$request ->getPost(); // array('a' => 'variable1', 'b' => 'variable2', 'c' => 'variable3')
// modifikace položky globální proměnné $_POST
$request ->modify( 'post' , 'b' , 'new-variable2' );
$request ->getPost(); // array('a' => 'variable1', 'b' => 'new-variable2', 'c' => 'variable3')
$request ->isMethod( 'get' ); // byl požadavek vyvolán metodou GET ?
$request ->getFiles(); // získání obsahu globální proměnné $_FILES
// získání parametrů poskytnutých presenteru (obvykle přes URL)
$request ->getParams(); // např: array('view' => 'default')
// jméno presenteru ve formátu Module:Presenter
$request ->getPresenterName(); // např: "Front:Homepage" See also:
- PresenterRequest API reference
- Presenter
- Routing



