PHP Classes

File: manuscript/6h.-Request.md

Recommend this page to a friend!
  Classes of Gjero Krsteski   PIMF   manuscript/6h.-Request.md   Download  
File: manuscript/6h.-Request.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PIMF
Framework for Web application development
Author: By
Last change: Update of manuscript/6h.-Request.md
Date: 7 months ago
Size: 697 bytes
 

Contents

Class file image Download

Request

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');