PHP Class yii\web\Application

Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\base\Application
Mostra file Open project: yiisoft/yii2 Class Usage Examples

Public Properties

Property Type Description
$catchAll the configuration specifying a controller action which should handle all user requests. This is mainly used when the application is in maintenance mode and needs to handle all incoming requests via a single action. The configuration is an array whose first element specifies the route of the action. The rest of the array elements (key-value pairs) specify the parameters to be bound to the action. For example, php [ 'offline/notice', 'param1' => 'value1', 'param2' => 'value2', ] Defaults to null, meaning catch-all is not used.
$controller the currently active controller instance
$defaultRoute the default route of this application. Defaults to 'site'.

Public Methods

Method Description
coreComponents ( )
getErrorHandler ( ) : ErrorHandler Returns the error handler component.
getHomeUrl ( ) : string
getRequest ( ) : Request Returns the request component.
getResponse ( ) : Response Returns the response component.
getSession ( ) : yii\web\Session Returns the session component.
getUser ( ) : User Returns the user component.
handleRequest ( Request $request ) : Response Handles the specified request.
setHomeUrl ( string $value )

Protected Methods

Method Description
bootstrap ( )

Method Details

bootstrap() protected method

protected bootstrap ( )

coreComponents() public method

public coreComponents ( )

getErrorHandler() public method

Returns the error handler component.
public getErrorHandler ( ) : ErrorHandler
return ErrorHandler the error handler application component.

getHomeUrl() public method

public getHomeUrl ( ) : string
return string the homepage URL

getRequest() public method

Returns the request component.
public getRequest ( ) : Request
return Request the request component.

getResponse() public method

Returns the response component.
public getResponse ( ) : Response
return Response the response component.

getSession() public method

Returns the session component.
public getSession ( ) : yii\web\Session
return yii\web\Session the session component.

getUser() public method

Returns the user component.
public getUser ( ) : User
return User the user component.

handleRequest() public method

Handles the specified request.
public handleRequest ( Request $request ) : Response
$request Request the request to be handled
return Response the resulting response

setHomeUrl() public method

public setHomeUrl ( string $value )
$value string the homepage URL

Property Details

$catchAll public_oe property

the configuration specifying a controller action which should handle all user requests. This is mainly used when the application is in maintenance mode and needs to handle all incoming requests via a single action. The configuration is an array whose first element specifies the route of the action. The rest of the array elements (key-value pairs) specify the parameters to be bound to the action. For example, php [ 'offline/notice', 'param1' => 'value1', 'param2' => 'value2', ] Defaults to null, meaning catch-all is not used.
public $catchAll

$controller public_oe property

the currently active controller instance
public $controller

$defaultRoute public_oe property

the default route of this application. Defaults to 'site'.
public $defaultRoute