http://manual.cakephp.org/view/39/configuration#routes-configuration-46
Specifically, check out the second code sample under Prefix Routing.
In your routing configuration, you would use
Router::connect('/frontend/:controller/:action', array('prefix' =>
'profiles')
Configure::write('Routing.admin', 'admin');
In your controller, you would have functions like:
index() (for all)
front_index() (for frontend users)
admin_index() (for admin users)
You would also need the corresponding views.
On Jun 13, 11:57 am, "Nicolás Andrade"
<[EMAIL PROTECTED]> wrote:
> Hi, I'm wondering how to use route to get different sections in Admin; in
> this way:
>
> 1-Users controller handles all users, front end users and administrators.
> 2-The field users.is_admin determines user's role.
>
> 3-I would like to get /admin/users/:Action/ to list and edit users where
> users.is_admin = 0; and /admin/admins/:action/ to list, edit and create
> users with users.is_admin = 1.
>
> I though using routes is the way to get it working, but I can not find
> exactly how.
>
> I've tried with the followings lines; 1 line each time, having different
> results. Sometimes Cake says a controller is missing (AdminsController),
> sometimes it overrides "/admin/" in the URL.
>
> Router::connect('/admins/', array('controller' => 'users', 'isadmin' =>
> 'true'));
> Router::connect('/admin/admins/', array('controller' => 'users', 'isadmin'
> => 'true'));
> Router::connect('/admin/admins/:action/', array('controller' => 'users',
> 'isadmin' => 'true'));
> Router::connect('/admin/admins/:action/*', array('controller' => 'users',
> 'isadmin' => 'true'));
> Router::connect('/admins/:action/*', array('controller' => 'users',
> 'isadmin' => 'true'));
>
> Any ideas or link to suggest?
>
> Thanks in advance, good cooking.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---