Create a base action with a "preExecute" method. Check in that method for
the user's group and change the layout accordingly. Then extend your actions
from this base action. This would be a way of doing it. Another way would be
maybe with a filter, but I like to have a baseAction and your requirement
fits to put it there:
// Put it in your app "lib" dir if it's app specific, or in project's "lib"
folder if it will be used globally
class baseAction extends sfActions
{
public function preExecute()
{
// Do your user's group check and other stuff here
// Change your layout accordingly
$this->setLayout( $myLayout );
}
}
// Then in your own actions
class myOwnAction extends baseAction
{
public function preExecute()
{
parent::preExecute();
// Do other stuff
}
}
On Sun, Sep 12, 2010 at 1:31 PM, ziclo <[email protected]> wrote:
> Hello,
>
> I use sfguard plugin and i want to display a layout dedicated to
> specific user's group (different menus/functionnalities).
>
> Sequences :
>
> 1 - user1 (group1) logs in
> 2 - route to homepage with the layout1
>
> If user2 (group2) logs in so he is redirected to the homepage with
> layout2.
>
> How can i do it ?
>
> Thank you
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en