http://book.cakephp.org/view/542/Defining-Routes
Your route would look something like:
Router::connect('/countries/:country_id/cities/*', array('controller'
=> 'cities', 'action' => 'someCityAction'));
The 'country_id' will be available in $this->params in the controller.
On 15 Oct 2008, at 08:31, machuidel wrote:
>
> Hello,
>
> How can I map a controller to an URL like "/countries/12/cities/" such
> that the index of cities will be filtered by the specified country? I
> would like that URL to dispatch the "city" controller (not the
> "country" controller) with the specified country as its argument.
> Something like:
>
> class CityController extends AppController {
>
> ...
>
> function index_country ($country_id) {
> // Index of cities filtered by specified country
> }
>
> ...
>
> }
>
> Could not find any example of someone doing this in Cakephp.
>
> Cheers,
> Mike
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---