php - Yii Bootstrap Navbar .active not applying on some pages -
i have yii project, user yii-bootsrtap. have static pages (like faq , page) user can access navbar. looks this:
index | | faq | login ...
my problem is, .active class not applying menubar item, when navigate static page. works on other pages, index , login.
i using own action render these static pages:
// in sitecontroller.php: public function actionstatic($view) { $this->render('static/' . $view); }
if you're using cmenu
show menu, adding active
key actual menu item may resolve problem.
if add below specific menu item, show active if controller action you're on 'blog':
'active'=>(yii::app()->controller->action->id=='blog')
the full snippet this:
$this->widget('zii.widgets.cmenu', array( 'items' => array( 'label'=>'blog', 'active'=>(yii::app()->controller->action->id=='blog') ) );
Comments
Post a Comment