Sachy
(Sachin Mandalia)
October 11, 2014, 11:08am
1
I received an error even if I had mentioned a condition in the menu array as below
array('label'=>'Reservation Requests <span class="badge badge-info pull-right">'.(Yii::app()->user->isGuest)? Message::model()->CountofReservationRequests(null) :''.'</span>', 'url'=>array('/site/login'), 'visible'=>!Yii::app()->user->isGuest),
Sachy
(Sachin Mandalia)
October 11, 2014, 4:28pm
3
Error means, its checking in the database (gives me database error) even if the user is logged out. the condition !Yii::app()->user->isGuest does not apply
Bizley
(Bizley)
October 11, 2014, 7:42pm
4
You’ve got brackets in wrong places.
array(
'label' => 'Reservation Requests <span class="badge badge-info pull-right">' .
(Yii::app()->user->isGuest ? Message::model()->CountofReservationRequests(null) : '') . '</span>',
'url' => array('/site/login'),
'visible' => !Yii::app()->user->isGuest
),
And I think it should be other way around but it’s just a wild guess
array(
'label' => 'Reservation Requests <span class="badge badge-info pull-right">' .
(Yii::app()->user->isGuest ? '' : Message::model()->CountofReservationRequests(null)) . '</span>',
'url' => array('/site/login'),
'visible' => !Yii::app()->user->isGuest
),
Sachy
(Sachin Mandalia)
October 11, 2014, 8:30pm
5
Bizley:
You’ve got brackets in wrong places.
array(
'label' => 'Reservation Requests <span class="badge badge-info pull-right">' .
(Yii::app()->user->isGuest ? Message::model()->CountofReservationRequests(null) : '') . '</span>',
'url' => array('/site/login'),
'visible' => !Yii::app()->user->isGuest
),
And I think it should be other way around but it’s just a wild guess
array(
'label' => 'Reservation Requests <span class="badge badge-info pull-right">' .
(Yii::app()->user->isGuest ? '' : Message::model()->CountofReservationRequests(null)) . '</span>',
'url' => array('/site/login'),
'visible' => !Yii::app()->user->isGuest
),
Thanks Bizley!! I missed the brackets somewhere, now works fine