Skip to content

6h. Request

Gjero Krsteski edited this page Jan 19, 2014 · 1 revision

You can work with Pimf\Request instance at any class which extends the Pimf\Controller\Base class, or you can create it somewhere else for at your application and retrieve the desired variables.

Creating a new instance outside of the controller.

$request = new Pimf\Request($_GET, $_POST, $_COOKIE, $_SERVER['argv']);

Retrieves the HTTP GET variables.

$request->fromGet()->get('name');

Retrieves the CLI arguments passed to script.

$request->fromCli()->get('name');

Retrieves the HTTP POST variables.

$request->fromPost()->get('name');

Retrieves the HTTP Cookies.

$request->fromCookie()->get('name');