I’m try to load the Yii Bootstrap extension in the admin module only but it’s not working. I’m assuming I need to preload it or initiate it somehow… Thanks!
class AdminModule extends CWebModule
{
public function init()
{
// import the module-level models and components
$this->setImport(array(
'admin.models.*',
'admin.components.*',
'ext.bootstrap.components.Bootstrap',
));
}
public function beforeControllerAction($controller, $action)
{
if(parent::beforeControllerAction($controller, $action))
{
$this->layout = 'admin';
return true;
}
else
return false;
}
}
There are 4 different ways to do this:
Add the configuration to the app’s configuration (protected/config/main.php):
Preload it in the
init:Preload in
initanother way:Preload in
inityet another way: