Свойство | Тип | Описание | |
---|---|---|---|
$bootstrap | list of components that should be run during the application [[bootstrap()|bootstrapping process]]. Each component may be specified in one of the following formats: - an application component ID as specified via [[components]]. - a module ID as specified via [[modules]]. - a class name. - a configuration array. During the bootstrapping process, each component will be instantiated. If the component class implements BootstrapInterface, its [[BootstrapInterface::bootstrap()|bootstrap()]] method will be also be called. | ||
$charset | the charset currently used for the application. | ||
$controller | the currently active controller instance | ||
$controllerNamespace | the namespace that controller classes are located in. This namespace will be used to load controller classes by prepending it to the controller class name. The default namespace is app\controllers. Please refer to the guide about class autoloading for more details. | ||
$extensions | list of installed Yii extensions. Each array element represents a single extension with the following structure: php [ 'name' => 'extension name', 'version' => 'version number', 'bootstrap' => 'BootstrapClassName', // optional, may also be a configuration array 'alias' => [ '@alias1' => 'to/path1', '@alias2' => 'to/path2', ], ] The "bootstrap" class listed above will be instantiated during the application [[bootstrap()|bootstrapping process]]. If the class implements BootstrapInterface, its [[BootstrapInterface::bootstrap()|bootstrap()]] method will be also be called. If not set explicitly in the application config, this property will be populated with the contents of @vendor/yiisoft/extensions.php. | ||
$language | the language that is meant to be used for end users. It is recommended that you use IETF language tags. For example, en stands for English, while en-US stands for English (United States). | ||
$layout | the layout that should be applied for views in this application. Defaults to 'main'. If this is false, layout will be disabled. | ||
$loadedModules | list of loaded modules indexed by their class names. | ||
$name | the application name. | ||
$requestedAction | the requested Action. If null, it means the request cannot be resolved into an action. | ||
$requestedParams | the parameters supplied to the requested action. | ||
$requestedRoute | the requested route | ||
$sourceLanguage | the language that the application is written in. This mainly refers to the language that the messages and view files are written in. | ||
$state | the current application state during a request handling life cycle. This property is managed by the application. Do not modify this property. |
Метод | Описание | |
---|---|---|
__construct ( array $config = [] ) | Constructor. | |
coreComponents ( ) | Returns the configuration of core application components. | |
end ( integer $status, |
Terminates the application. | |
getAssetManager ( ) : |
Returns the asset manager. | |
getAuthManager ( ) : yii\rbac\ManagerInterface | Returns the auth manager for this application. | |
getCache ( ) : |
Returns the cache component. | |
getDb ( ) : |
Returns the database connection component. | |
getErrorHandler ( ) : |
Returns the error handler component. | |
getFormatter ( ) : |
Returns the formatter component. | |
getI18n ( ) : yii\i18n\I18N | Returns the internationalization (i18n) component | |
getLog ( ) : |
Returns the log dispatcher component. | |
getMailer ( ) : yii\mail\MailerInterface | Returns the mailer component. | |
getRequest ( ) : |
Returns the request component. | |
getResponse ( ) : |
Returns the response component. | |
getRuntimePath ( ) : string | Returns the directory that stores runtime files. | |
getSecurity ( ) : |
Returns the security component. | |
getTimeZone ( ) : string | Returns the time zone used by this application. | |
getUniqueId ( ) : string | Returns an ID that uniquely identifies this module among all modules within the current application. | |
getUrlManager ( ) : |
Returns the URL manager for this application. | |
getVendorPath ( ) : string | Returns the directory that stores vendor files. | |
getView ( ) : |
Returns the view object. | |
handleRequest ( |
Handles the specified request. | |
init ( ) | ||
preInit ( array &$config ) | Pre-initializes the application. | |
run ( ) : integer | Runs the application. | |
setBasePath ( string $path ) | Sets the root directory of the application and the @app alias. | |
setContainer ( array $config ) | Configures [[Yii::$container]] with the $config | |
setRuntimePath ( string $path ) | Sets the directory that stores runtime files. | |
setTimeZone ( string $value ) | Sets the time zone used by this application. | |
setVendorPath ( string $path ) | Sets the directory that stores vendor files. |
Метод | Описание | |
---|---|---|
bootstrap ( ) | Initializes extensions and executes bootstrap components. | |
registerErrorHandler ( array &$config ) | Registers the errorHandler component as a PHP error handler. |
public __construct ( array $config = [] ) | ||
$config | array | name-value pairs that will be used to initialize the object properties. Note that the configuration must contain both [[id]] and [[basePath]]. |
protected bootstrap ( ) |
public coreComponents ( ) |
public getAssetManager ( ) : |
||
Результат | the asset manager application component. |
public getAuthManager ( ) : yii\rbac\ManagerInterface | ||
Результат | yii\rbac\ManagerInterface | the auth manager application component. Null is returned if auth manager is not configured. |
public getCache ( ) : |
||
Результат | the cache application component. Null if the component is not enabled. |
public getDb ( ) : |
||
Результат | the database connection. |
public getErrorHandler ( ) : |
||
Результат | the error handler application component. |
public getFormatter ( ) : |
||
Результат | the formatter application component. |
public getI18n ( ) : yii\i18n\I18N | ||
Результат | yii\i18n\I18N | the internationalization application component. |
public getLog ( ) : |
||
Результат | the log dispatcher application component. |
public getMailer ( ) : yii\mail\MailerInterface | ||
Результат | yii\mail\MailerInterface | the mailer application component. |
public getRequest ( ) : |
||
Результат | the request component. |
public getResponse ( ) : |
||
Результат | the response component. |
public getRuntimePath ( ) : string | ||
Результат | string | the directory that stores runtime files. Defaults to the "runtime" subdirectory under [[basePath]]. |
public getSecurity ( ) : |
||
Результат | the security application component. |
public getTimeZone ( ) : string | ||
Результат | string | the time zone used by this application. |
public getUniqueId ( ) : string | ||
Результат | string | the unique ID of the module. |
public getUrlManager ( ) : |
||
Результат | the URL manager for this application. |
public getVendorPath ( ) : string | ||
Результат | string | the directory that stores vendor files. Defaults to "vendor" directory under [[basePath]]. |
public getView ( ) : |
||
Результат | the view application component that is used to render various view files. |
abstract public handleRequest ( |
||
$request | the request to be handled | |
Результат | the resulting response |
protected registerErrorHandler ( array &$config ) | ||
$config | array | application config |
public setBasePath ( string $path ) | ||
$path | string | the root directory of the application. |
public setContainer ( array $config ) | ||
$config | array | values given in terms of name-value pairs |
public setRuntimePath ( string $path ) | ||
$path | string | the directory that stores runtime files. |
public setTimeZone ( string $value ) | ||
$value | string | the time zone used by this application. |
public setVendorPath ( string $path ) | ||
$path | string | the directory that stores vendor files. |
public $bootstrap |
public $controllerNamespace |
public $extensions |
public $language |
public $layout |
public $loadedModules |
public $requestedAction |
public $requestedParams |
public $sourceLanguage |