Request - rbertram90/core GitHub Wiki

Summary

Documentation for src/Request.php

Contents

Constructor

Public Properties

Public Methods

Constructor

new Request([array $options = array()]);

// Request requires following structure:
//   index.php?p=controller&query=content/123
// Likely to have been redirected from:
//   /controller/content/123
// Name of controller request parameter key can be changed (defaults to 'p')

$options = [
    'controllerName' => 'p'
];

Public Properties

isAjax

Is this request initiated by ajax? Defaults to false

Public Methods

method

Get the request method (GET/POST)

string method(void)

getInt

Get sanitized value of a integer request variable

int getInt(string $key [, int $default = 0])

getFloat

Get sanitized value of a float request variable

int getFloat(string $key [, float $default = 0.0])

getString

Get sanitized value of a string request variable

string getString(string $key [, string $default = ''])

getControllerName

Get the name of the controller to be used to handle request

string getControllerName()

getUrlParameter

Get the value of an argument passed through the URL by index

string getUrlParameter(string $index [, mixed $default = false])