yii\web\Application::bootstrap PHP Method

bootstrap() protected method

protected bootstrap ( )
    protected function bootstrap()
    {
        $request = $this->getRequest();
        Yii::setAlias('@webroot', dirname($request->getScriptFile()));
        Yii::setAlias('@web', $request->getBaseUrl());
        parent::bootstrap();
    }

Usage Example

Example #1
0
 protected function bootstrap()
 {
     $this->i18n->addClassAlias('app/', "{$this->getBasePath()}/messages");
     parent::bootstrap();
     $this->language = 'ru-RU';
 }