Yii Framework Forum: How to hide main menu in login page? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to hide main menu in login page? Rate Topic: -----

#1 User is offline   JFReyes 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 508
  • Joined: 28-October 09
  • Location:Puerto Rico

Posted 18 April 2010 - 07:33 AM

Hi all:

My application has both a front and back end. I'd like to hide the backend menu until after the admin user logs in. How would I do that while keeping the default layout structure? Thanks for the help.
José
0

#2 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 18 April 2010 - 07:44 AM

You should render menu only if !Yii::app()->user->isGuest and has permissions to view admin page (if you are using RBAC).
Simple case:

if (!Yii::app()->user->isGuest)
    $this->widget('CMenu', ... );

0

#3 User is offline   JFReyes 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 508
  • Joined: 28-October 09
  • Location:Puerto Rico

Posted 18 April 2010 - 08:40 AM

Thanks for the tip, andy_s! I'll start with the simple case because I haven't installed RBAC yet, but it's coming.
José
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users