Answer the question
In order to leave comments, you need to log in
How to add a part to a yii2 project as a frontend or backend?
Good day. I am developing a project on yii2 advanced, I added the employee folder to the project root and copied the contents of the frontend folder there. registered in config / main: 'controllerNamespace' => 'employee\controllers',
after that it started throwing out:
An Error occurred while handling another error:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' in D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\base\Module.php:532
Stack trace:
#0 D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\web\ErrorHandler.php(97): yii\base\Module->runAction('site/error')
#1 D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\base\ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#2 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#3 {main}
Previous exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/index".' in D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\base\Module.php:532
Stack trace:
#0 D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\web\Application.php(102): yii\base\Module->runAction('site/index', Array)
#1 D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 D:\OpenServer\domains\flightAreportSistem.loc\employee\web\index.php(17): yii\base\Application->run()
#3 {main}
Next exception 'yii\web\NotFoundHttpException' with message 'Page not found.' in D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\web\Application.php:114
Stack trace:
#0 D:\OpenServer\domains\flightAreportSistem.loc\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 D:\OpenServer\domains\flightAreportSistem.loc\employee\web\index.php(17): yii\base\Application->run()
#2 {main}
Answer the question
In order to leave comments, you need to log in
\common\config\bootstrap.php
add:
it turned out to be enough for me to add a folder to the root of the project
copied the contents of the frontend folder there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question