Skip to content

Commit

Permalink
Merge pull request noumo#79 from noumo/layout
Browse files Browse the repository at this point in the history
Controller layout fix
  • Loading branch information
noumo committed Aug 16, 2015
2 parents 29a41ba + 3681b0b commit 9c73587
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion AdminModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class AdminModule extends \yii\base\Module implements BootstrapInterface

public $settings;
public $activeModules;
public $controllerLayout = '@easyii/views/layouts/main';

private $_installed;

Expand Down Expand Up @@ -71,4 +72,4 @@ public function getInstalled()
}
return $this->_installed;
}
}
}
9 changes: 7 additions & 2 deletions components/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -118,4 +123,4 @@ public function formatResponse($success = '', $back = true)
return $back ? $this->back() : $this->refresh();
}
}
}
}

0 comments on commit 9c73587

Please sign in to comment.