On 1/9/2010 10:16 PM, kyle wrote:

LAYOUT1: (public no auth required): Homepage + BlogArticles + Login
LAYOUT2: (user logged into system): User Homepage + Links to the parts
of the backend System
LAYOUT3: (admin user): Admin Homepage + Links to edit and manage all
aspects of system


This is actually very simple in cake.

Write your layouts in views/layouts/ .
In your app_controller beforefilter() check for logged in user and set the desired layout:

E.g.
$user = $this->Auth->user('group_name'); // or whatever

    if($user == 'user'){
        $this->layout = 'layout3';
    }elseif($user == 'admin'){
        $this->layout = 'layout2';
    }else{
        $this->layout = 'layout1';
    }

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to