Methods summary
public
array
&
|
|
public
MvcCore\Request
|
#
SetParams( array & $params = [] )
Parameters
Returns
Inheritdocs
|
public
array
&
|
#
GetParams( string|array|boolean $pregReplaceAllowedChars = ['#[\<\>\'"]#' => ''], array $onlyKeys = [] )
Parameters
- $pregReplaceAllowedChars
- If String - list of regular expression characters to only keep, if array -
preg_replace() pattern and reverse, if FALSE , raw value is returned.
- $onlyKeys
- Array with keys to get only. If empty (by default), all possible params are returned.
Returns
array
Inheritdocs
|
public
MvcCore\Request
|
#
SetParam( string $name = '', string|string[] $value = '' )
Parameters
Returns
Inheritdocs
|
public
MvcCore\Request
|
#
RemoveParam( string $name = '' )
Parameters
Returns
Inheritdocs
|
public
string|string[]|integer|int[]|boolean|bool[]|array|mixed
|
#
GetParam( string $name = '', string|array|boolean $pregReplaceAllowedChars = "a-zA-Z0-9_;, /\-\@\:", mixed $ifNullValue = NULL, string $targetType = NULL )
Parameters
- $name
- Parameter string name.
- $pregReplaceAllowedChars
- If String - list of regular expression characters to only keep, if array -
preg_replace() pattern and reverse, if FALSE , raw value is returned.
- $ifNullValue
- Default value returned if given param name is null.
- $targetType
- Target type to retype param value or default if-null value. If param is an array, every param item will be retyped into given target type.
Returns
string|string[]|integer|int[]|boolean|bool[]|array|mixed
Throws
InvalidArgumentException
$name must be a $targetType , not an array .
Inheritdocs
|
public
boolean
|
#
HasParam( string $name = '' )
Parameters
- $name
- Parameter string name.
Returns
boolean
Inheritdocs
|
public
MvcCore\Request
|
#
SetFiles( array & $files = [] )
Parameters
Returns
Inheritdocs
|
public
array
&
|
|
public
MvcCore\Request
|
#
SetFile( string $file = '', array $data = [] )
Parameters
- $file
- Uploaded file string name.
- $data
Returns
Inheritdocs
|
public
array
|
#
GetFile( string $file = '' )
Parameters
- $file
- Uploaded file string name.
Returns
array
Inheritdocs
|
public
boolean
|
#
HasFile( string $file = '' )
Parameters
- $file
- Uploaded file string name.
Returns
boolean
Inheritdocs
|
public
MvcCore\Request
|
#
SetCookies( array & $cookies = [] )
Parameters
Returns
Inheritdocs
|
public
array
&
|
#
GetCookies( string|array|boolean $pregReplaceAllowedChars = ['#[\<\>\'"]#' => ''], array $onlyKeys = [] )
Parameters
- $pregReplaceAllowedChars
- If String - list of regular expression characters to only keep, if array -
preg_replace() pattern and reverse, if FALSE , raw value is returned.
- $onlyKeys
- Array with keys to get only. If empty (by default), all possible cookies are returned.
Returns
array
Inheritdocs
|
public
MvcCore\Request
|
#
SetCookie( string $name = "", string|string[] $value = "" )
Parameters
Returns
Inheritdocs
|
public
string|string[]|integer|int[]|boolean|bool[]|array|mixed
|
#
GetCookie( string $name = '', string|array|boolean $pregReplaceAllowedChars = "a-zA-Z0-9_;, /\-\.\@\=\+\?\!", mixed $ifNullValue = NULL, string $targetType = NULL )
Parameters
- $name
- Cookie string name.
- $pregReplaceAllowedChars
- If String - list of regular expression characters to only keep, if array -
preg_replace() pattern and reverse, if FALSE , raw value is returned.
- $ifNullValue
- Default value returned if given param name is null.
- $targetType
- Target type to retype param value or default if-null value. If param is an array, every param item will be retyped into given target type.
Returns
string|string[]|integer|int[]|boolean|bool[]|array|mixed
Throws
InvalidArgumentException
$name must be a $targetType , not an array .
Inheritdocs
|
public
boolean
|
#
HasCookie( string $name = '' )
Parameters
- $name
- Cookie string name.
Returns
boolean
Inheritdocs
|
protected
string|string[]|integer|int[]|boolean|bool[]|array|mixed
|
#
getParamItem( string|string[]|null & $rawValue = NULL, string|array|boolean $pregReplaceAllowedChars = "a-zA-Z0-9_;, /\-\@\:", mixed $ifNullValue = NULL, string $targetType = NULL )
Get filtered param or header value for characters defined as second argument to use them in preg_replace() .
Get filtered param or header value for characters defined as second argument to use them in preg_replace() .
Parameters
- $rawValue
- $pregReplaceAllowedChars
- If String - list of regular expression characters to only keep, if array -
preg_replace() pattern and reverse, if FALSE , raw value is returned.
- $ifNullValue
- Default value returned if given param name is null.
- $targetType
- Target type to retype param value or default if-null value. If param is an array, every param item will be retyped into given target type.
Returns
string|string[]|integer|int[]|boolean|bool[]|array|mixed
|
protected
string
|
#
cleanParamValue( string $rawValue, string|array|boolean $pregReplaceAllowedChars = "a-zA-Z0-9_;, /\-\@\:" )
Clean param value by given list of allowed chars or by given preg_replace() pattern and reverse.
Clean param value by given list of allowed chars or by given preg_replace() pattern and reverse.
Parameters
- $rawValue
- $pregReplaceAllowedChars
- If String - list of regular expression characters to only keep, if array -
preg_replace() pattern and reverse, if FALSE , raw value is returned.
Returns
string
|