Hi!
While working with admin routing, remember to mention just action in
the redirect array if you are redirecting within same model.
Like if current page is:
/admin/users/manage
and you have to redirect, after some action, to the user profile the
redirection will be:
$this->redirect(array('action' => 'view', $id));
otherwise if the required redirection is to manage the orders, the
redirection may be:
$this->redirect(array('controller' => 'orders', 'action' =>
'manage'));
That's all!
Hope it will work!
On Jan 8, 9:07 am, brian <[email protected]> wrote:
> Anyone else have a model named Admin? I'm trying to figure out how to
> deal with admin routing, given I have a controller named, admins. I
> did have this working earlier but, as with so many things Cake
> routing, it's all messed up suddenly.
>
> Don't get me wrong--the reverse routing has been terrific. Only, I
> feel like I'm screwed on this.
>
> I have this route:
>
> Router::connect(
> '/admins',
> array(
> 'controller' => 'admins', 'action' => 'index'
> )
> );
>
> When an admin logs in, I can redirect fine with:
>
> array('controller' => 'admins', 'action' => 'index')
>
> The problem is that, if an admin does some action which is under admin
> routing, the redirect (using the above array) retains the '/amin'
> part, so I'm redirected to "/admin/admins".
>
> What's the best way to have an "Admin home page"? I need to have a
> single page where admins can select tasks, etc.
>
> If I have to, I'll change the model name. That's no big deal. But,
> whatever actions it has will always be under admin routing, anyway.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---