I am a yiibie, and i am stuck at a point. I have three roles in my project. 1.Admin. 2.Owner 3. Authenticated User. I have a header and a footer widget.In header widget which is
Is easy after login you can see the username otherwise you see nothings
<?php
if (!Yii::app()->user->isGuest) {
echo Yii::app()->user->name;
}
?>
Read the documentation please.
This will be helpful:
http://www.yiiframework.com/doc/api/1.1/CWebUser#isGuest-detail
Here example: http://pastebin.com/r0XpkPNZ