diff --git a/AdminModule.php b/AdminModule.php index 716d6f2..098e75e 100644 --- a/AdminModule.php +++ b/AdminModule.php @@ -16,6 +16,7 @@ class AdminModule extends \yii\base\Module implements BootstrapInterface public $settings; public $activeModules; + public $controllerLayout = '@easyii/views/layouts/main'; private $_installed; @@ -71,4 +72,4 @@ public function getInstalled() } return $this->_installed; } -} \ No newline at end of file +} diff --git a/components/Controller.php b/components/Controller.php index 4ef82ec..1dadc76 100644 --- a/components/Controller.php +++ b/components/Controller.php @@ -12,9 +12,14 @@ class Controller extends \yii\web\Controller { public $enableCsrfValidation = false; - public $layout = '@easyii/views/layouts/main'; public $rootActions = []; public $error = null; + + public function init() + { + parent::init(); + $this->layout = Yii::$app->getModule('admin')->controllerLayout; + } /** * Check authentication, and root rights for actions @@ -118,4 +123,4 @@ public function formatResponse($success = '', $back = true) return $back ? $this->back() : $this->refresh(); } } -} \ No newline at end of file +}