Request

Munee Request Class

author

Cody Lundquist

Methods

Constructor

__construct(array $options = array()) 

Arguments

$options

array

Sets the document root.

setWebroot(string $path) : object

Arguments

$path

string

Response

object

Sets either an individual _rawParams key - or overwrites the whole array.

setRawParam(mixed $key, mixed $value = null) : object

Arguments

$key

mixed

$value

mixed

Response

object

Returns the pre-parsed raw params

getRawParams() : array

Response

array

Sets the $rawFiles.

setFiles(string $files) : object

Arguments

$files

string

Response

object

Parses the $rawFiles and does sanity checks

init() 
throws

Parse query string parameter arguments based on mapped allowed params

parseParams(array $allowedParams) 

Arguments

$allowedParams

array

Setup the default values for the allowed parameters

setDefaultParams() 

Grabs the params options taking into account any aliases

getParamOptions(mixed $checkParam) : bool|array

Arguments

$checkParam

mixed

Response

bool|array

Grabs a value from a param by running it through supplied regex

getParamValue(mixed $param, mixed $paramOptions, mixed $value) : string|array
throws

Arguments

$param

mixed

$paramOptions

mixed

$value

mixed

Response

string|array

Helper function to cast values

castValue(mixed $cast, mixed $value) : bool|int|string

Arguments

$cast

mixed

$value

mixed

Response

bool|int|string

Properties

Stores the path to Webroot

webroot
var

Stores the file extension of the current request

ext
var

Stores the array of passed in parameters

params
var

Stores the array of files passed in

files
var

Stores the array of Request Options

options
var

Stores the array of Raw $_GET parameters

rawParams
var

Stores the array of allowed parameters for the particular asset being processed

allowedParams
var

Stores the string of raw files passed in from $_GET

rawFiles
var