Thursday, July 30, 2009

Re: get the controller from the named argument

Hi,

I'm not 100% sure but I think the urls you want to use aren't going to
work because of the slashes in the named argument. Now the named
argument 'subdomain' will be 'www' and 'home' will be passed as an
other variable.

Maybe you could do something like this:

url:

/subdomain/www/home

routing:

Router::connect('*/subdomain/:controller/:action/*');

Even if this works it will bring a whole lot of other problems. I
don't know what benefit you expect from the chosen url setup, but you
might want to reconsider.

-Roel

On 30 jul, 19:07, Evert <Compa...@gmail.com> wrote:
> I have a named argument in my URLs, so it could look like this:
>
> /subdomain:www/home
> /subdomain:forum/topic/23
>
> etc..
>
> now I want that some of those named-arguments go to certain
> controllers and all the others go the pages-controller
> but I am a complete noob when it comes to routing. I tried this, but
> obviously it doesn't work:
>
> Router::connect('/:subdomain/*', array('subdomain' => 'forum',
> 'controller' => 'forum'));
> Router::connect('/:subdomain/*', array('subdomain' => 'wiki',
> 'controller' => 'wiki'));
> Router::connect('/:subdomain/*', array('subdomain' => 'docs',
> 'controller' => 'docs'));
> Router::connect('/:subdomain/*', array('subdomain' => '*',
> 'controller' => 'pages'));
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: