[ 'class' => AccessControl::className(), 'rules' => [ [ 'allow' => true, ], ], ], ]; } public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', ], ]; } public function actionIndex() { // init db connection Yii::$app->getDb()->open(); // generate XSRF cookie Yii::$app->request->getCsrfToken(); $viewPath = ('source' === APP_SRC_MODE) ? Yii::getAlias('@app/views/site/site-index-debug.php') : Yii::getAlias('@webroot/site-index.php'); if (!file_exists($viewPath)) { throw new HttpException(404, 'Application build not found'); } return $this->renderFile($viewPath); } }