zatmont
(Senubabe)
March 12, 2013, 9:24am
1
Hi all,
In my application there are three different user types. These users will be redirected to their own pages after login. The problem is the sidebar each user type uses is different and since column2.php is the file that loads the sidebar I wanted to be able to change that in a way the users will have sidebar menu that corresponds to their type.
I need help in making this work
Thanks in advance.
Balu
(Mbalu123)
March 12, 2013, 9:44am
2
zatmont:
Hi all,
In my application there are three different user types. These users will be redirected to their own pages after login. The problem is the sidebar each user type uses is different and since column2.php is the file that loads the sidebar I wanted to be able to change that in a way the users will have sidebar menu that corresponds to their type.
I need help in making this work
Thanks in advance.
give a condition like this.
$userId = Yii::app()->user->getId();
//check whether job seeker or employeer
$profile = User::model()->findByAttributes(array('id'=>$userId));
if($profile->profile=='1'){
//job seeker menu
}else{
//employeer menu
}
zatmont
(Senubabe)
March 12, 2013, 5:54pm
3
Balu:
give a condition like this.
$userId = Yii::app()->user->getId();
//check whether job seeker or employeer
$profile = User::model()->findByAttributes(array('id'=>$userId));
if($profile->profile=='1'){
//job seeker menu
}else{
//employeer menu
}
Hi Balu,
thanks for swift and helpful reply.
dniznick
(Dniznick)
March 13, 2013, 4:55am
4
If you are using CMenu or bootstrap menu there is a ‘visible’ property you can use to show or not show based on role or other attribute.