Well, it doesn't make much sense if you combine the two, as you'll end
up passing 'prefix' => 'admin' on the non-admin calls. This will screw
around with any auth code you have that uses this prefix.

I generally don't worry about routing admin functions, as it is only a
few clients who see it, and therefore the whole "easy to remember" and
"seo-friendly" aspects are irrelevant.

Adam

On Dec 22, 8:22 am, Joel Stein <[EMAIL PROTECTED]> wrote:
> Quick question... I'm trying to assign a route to a controller, both
> in the case of admin urls and without.  Is there an easy way to
> consolidate these two lines?
>
> Router::connect('/admin/bulletin/:action/*', array('plugin' =>
> 'newsletter', 'controller' => 'newsletter', 'prefix' => 'admin'));
> Router::connect('/bulletin/:action/*', array('plugin' => 'newsletter',
> 'controller' => 'newsletter'));
>
> I thought something like this might work, but didn't know how to
> finish it:
>
> Router::connect('/(admin/)?bulletin/:action/*', array('plugin' =>
> 'newsletter', 'controller' => 'newsletter', 'prefix' => 'admin'));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to