php - link a bootstrap to a certain module -
i have difficulty in connecting bootstrap module. bootstrap location at: mainfolder/protected/extensions/bootstrap/theme/abound
protected/config/main.php
yii::setpathofalias('bootstrap', dirname(__file__).'/../extensions/bootstrap'); 'modules'=>array( 'admin', 'consultant'=>array( 'preload'=>array('bootstrap'), 'components'>array( 'bootstrap'=>array( 'class'=>'bootstrap.theme.abound' ), ), ), 'candidate', ),
protected/modules/consultant/consultantmodule.php
class consultantmodule extends cwebmodule { public function init() { $this->setimport(array( 'consultant.models.*', 'consultant.components.*', )); yii::app()->getcomponent('bootstrap'); } }
structure of folder:
mainfolder protected config **main.php** extensions bootstrap assets components form gii theme **abound** widgets modules consultant controllers models views **consultantmodule.php**
error when run code:
property "consultantmodule.0" not defined.
is because properties inside module's consultant wrong or way place bootstrap not correct? can't figure out problem.
instead of calling bootstrap in each individual module, why not lazy-load once @ beginning of app , use in desired views? enter following code @ beginning of config/main.php file before components array:
'preload'=>array( 'bootstrap' ),
also, need add yii-booster extension in order work.
Comments
Post a Comment