Hi Marcin,

Cake 1.2 adds support for this.  In app/config/routes.php, you can  
add a route like the following:

Router::connect('/:car_brand', array('controller' => 'cars', 'action'  
=> 'view'), array('car_brand' => 'bmw|toyota|nissan'));

The only issue is that all the possible values of car_brand must be  
hard-coded into the route.

-Nate

> Date: Wed, 1 Nov 2006 11:27:21 +0000
> From: "Marcin Szkudlarek" <[EMAIL PROTECTED]>
> Subject: [nyphp-talk] cake url question
> To: [email protected]
> Message-ID:
>       <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I would like to map multiple url to one controller method like this:
>
> example.com/bmw
> example.com/toyota
> example.com/nissan
> ..
> should invoke method (for example "view") in my controller with  
> parameter
> "bmw", "toyota" etc.
> Probably I should configure it in routes.php but I don't have idea  
> how.
>
> Regards,
>
> Marcin
> -------------- next part --------------

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to