in my layout page Cmenu visible fn Yii::app()->user->isAdmin()
is not working properly when i use Yii::app()->user->isAdmin()
in someother view it showing correct value but not working in layout.
my code in protected/views/layouts/main.php
<?php $this->widget('zii.widgets.CMenu',array(
'items'=>array(
array('label'=>'Home', 'url'=>array('/site/index'),/*'visible'=>!Yii::app()->user->isGuest*/),
array('label'=>'Master','url'=>array('/site/master'),'visible'=>Yii::app()->user->isAdmin()),
array('label'=>'Transaction','url'=>array('/site/transaction'),'visible'=>Yii::app()->user->isAdmin()),
array('label'=>' Alotted Task','url'=>array('/site/alottedtask'),'visible'=>!Yii::app()->user->isGuest),
array('label'=>'Completed Task','url'=>array('/site/completedtask'),'visible'=>!Yii::app()->user->isGuest),
array('label'=>'Status Update', 'url'=>array('/site/statusupdate'),'visible'=>Yii::app()->user->isAdmin()),
array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
),
)); ?>
it showing the error like
Trying to get property of non-object
Update:
My error page http://localhost/tracktest/index.php