PHP Class yii\base\Request

For more details and usage information on Request, see the guide article on requests.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends Component
Show file Open project: yiisoft/yii2 Class Usage Examples

Public Methods

Method Description
getIsConsoleRequest ( ) : boolean Returns a value indicating whether the current request is made via command line
getScriptFile ( ) : string Returns entry script file path.
resolve ( ) : array Resolves the current request into a route and the associated parameters.
setIsConsoleRequest ( boolean $value ) Sets the value indicating whether the current request is made via command line
setScriptFile ( string $value ) Sets the entry script file path.

Method Details

getIsConsoleRequest() public method

Returns a value indicating whether the current request is made via command line
public getIsConsoleRequest ( ) : boolean
return boolean the value indicating whether the current request is made via console

getScriptFile() public method

Returns entry script file path.
public getScriptFile ( ) : string
return string entry script file path (processed w/ realpath())

resolve() abstract public method

Resolves the current request into a route and the associated parameters.
abstract public resolve ( ) : array
return array the first element is the route, and the second is the associated parameters.

setIsConsoleRequest() public method

Sets the value indicating whether the current request is made via command line
public setIsConsoleRequest ( boolean $value )
$value boolean the value indicating whether the current request is made via command line

setScriptFile() public method

The entry script file path can normally be determined based on the SCRIPT_FILENAME SERVER variable. However, for some server configurations, this may not be correct or feasible. This setter is provided so that the entry script file path can be manually specified.
public setScriptFile ( string $value )
$value string the entry script file path. This can be either a file path or a path alias.