PHP Class CampRequest

Show file Open project: sourcefabric/newscoop Class Usage Examples

Public Methods

Method Description
GetInput ( string $p_reqMethod = 'default' ) : array Returns the whole parameters array for the given input method.
GetMethod ( ) : string Returns the method used to read the input data: GET, POST etc.
GetURL ( ) : string Gets the current URL.
GetVar ( string $p_varName, mixed $p_defaultValue = null, string $p_reqMethod = 'default', string $p_dataType = null ) : mixed Gets a var from the input.
SetVar ( string $p_varName, mixed $p_varValue = null, string $p_reqMethod = 'default', boolean $p_overwrite = true ) Sets the value to the given variable.

Private Methods

Method Description
InitInput ( string &$p_reqMethod ) Initializes the input parameters array
TranslateMethod ( &$p_reqMethod ) : string Returns a valid input method name

Method Details

GetInput() public static method

Returns the whole parameters array for the given input method.
public static GetInput ( string $p_reqMethod = 'default' ) : array
$p_reqMethod string
return array

GetMethod() public static method

Returns the method used to read the input data: GET, POST etc.
public static GetMethod ( ) : string
return string

GetURL() public static method

Gets the current URL.
public static GetURL ( ) : string
return string The current URL

GetVar() public static method

Allows to fetch the variable value requested from the appropiate input method.
public static GetVar ( string $p_varName, mixed $p_defaultValue = null, string $p_reqMethod = 'default', string $p_dataType = null ) : mixed
$p_varName string The name of the variable to be fetched.
$p_defaultValue mixed The default value to be fetched for the given variable
$p_reqMethod string The requested input method, default is REQUEST
$p_dataType string TODO to be implemented
return mixed $var The value of the requested variable

SetVar() public static method

Sets the value to the given variable.
public static SetVar ( string $p_varName, mixed $p_varValue = null, string $p_reqMethod = 'default', boolean $p_overwrite = true )
$p_varName string The name of the variable to be set
$p_varValue mixed The variable value to be assigned
$p_reqMethod string The input method
$p_overwrite boolean Whether overwrite the current value of the variable or not