We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
project/src/framework/controllers/BaseAdminController.php
namespace app\framework\controllers; use yii\base\Theme; use yii\web\Controller; abstract class BaseAdminController extends Controller { public function init() { parent::init(); \Yii::$app->getView()->theme = new Theme([ 'basePath' => '@themes/admin', 'baseUrl' => '@web/themes/admin', 'pathMap' => [ '@app/views' => '@themes/admin', ], ]); //print_r(\Yii::$app->getView()->theme); //die("hello"); } }
project/src/modules/site/controllers/AdminSiteController.php
namespace app\modules\site\controllers; use app\framework\controllers\BaseAdminController; use yii\filters\AccessControl; class AdminSiteController extends BaseAdminController { public function behaviors() { return [ 'access' => [ 'class' => AccessControl::class, 'only' => ['logout', 'signup'], 'rules' => [ [ 'actions' => ['signup'], 'allow' => true, 'roles' => ['?'], ], [ 'actions' => ['logout'], 'allow' => true, 'roles' => ['@'], ], ], ], ]; } public function actions() { return [ 'error' => [ 'class' => \yii\web\ErrorAction::class, ], ]; } }
config.php
'errorHandler' => [ 'errorAction' => 'site/admin-site/error', ],
Error
An Error occurred while handling another error: yii\base\ViewNotFoundException: The view file does not exist: /var/www/vhosts/ulkanv2/ulkansayt/template/src/modules/site/views/admin-site/error.php in /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/View.php:234 Stack trace: #0 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/View.php(157): yii\base\View->renderFile() #1 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/Controller.php(407): yii\base\View->render() #2 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/web/ErrorAction.php(139): yii\base\Controller->render() #3 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/web/ErrorAction.php(118): yii\web\ErrorAction->renderHtmlResponse() #4 [internal function]: yii\web\ErrorAction->run() #5 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/Action.php(93): call_user_func_array() #6 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\Action->runWithParams() #7 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction() #8 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/web/ErrorHandler.php(109): yii\base\Module->runAction() #9 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/ErrorHandler.php(152): yii\web\ErrorHandler->renderException() #10 [internal function]: yii\base\ErrorHandler->handleException() #11 {main} Previous exception: yii\base\InvalidRouteException: Unable to resolve the request "admin/index.php". in /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/Module.php:561 Stack trace: #0 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction() #1 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest() #2 /var/www/vhosts/ulkanv2/ulkansayt/template/public/index.php(19): yii\base\Application->run() #3 {main} Next yii\web\NotFoundHttpException: Page not found. in /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/web/Application.php:115 Stack trace: #0 /var/www/vhosts/ulkanv2/ulkansayt/template/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest() #1 /var/www/vhosts/ulkanv2/ulkansayt/template/public/index.php(19): yii\base\Application->run() #2 {main}
In this project we do not want default view folders like @app/views. We want all view files in theme folder, because we have many themes for one site.
@app/views
The text was updated successfully, but these errors were encountered:
Including errors?
Sorry, something went wrong.
Yes Do you mean error view file should be in @app/views? That is, themes must not have error.php?
Try it.
No branches or pull requests
project/src/framework/controllers/BaseAdminController.php
project/src/modules/site/controllers/AdminSiteController.php
config.php
Error
In this project we do not want default view folders like
@app/views
. We want all view files in theme folder, because we have many themes for one site.The text was updated successfully, but these errors were encountered: