Setup a route like this:
Router::connect('/categories/*', array('controller' => 'categories',
'action' => 'index'));
Then in your index() method of CategoriesController you can then check for
the additional params in $this->params...
This is not so dissimilar how Cake's PagesController works.
I do something like this, however I store the entire path (eg "slug1/slug2")
in the database, since you might have duplicate identifiers like so:
/categories/sony/video-cameras/
/categories/philips/video-cameras/
Cheers,
Adam
----- Original Message -----
From: <[email protected]>
To: "CakePHP" <[email protected]>
Sent: Tuesday, June 23, 2009 8:20 PM
Subject: n-categories URL routing
>
> Hi,
> I it possible to make such a URL routing in cake?
>
> subdomain.example.com/categories/category1/category2/category-n
>
> I am wondering whether is possible to specify an URL relatively for N-
> levels of nested sub-categories...
>
> imagine you have e.g. eshop with following structure:
>
> *Electronics
> *****Computers
> ********Accesories
>
> So the following url would look like
> - Electronics/Computers/Accesories
>
> for accessing accesories I need only accesories slug or ID - and it
> already knows its parents in the tree representation. How can I
> relatively specify in router that everything in-between categories and
> category-n (******)
> is ignored?? or in other words, how to extract only the last items
> which is the identifier??
>
> myshop.example.com/categories/******/******/******/******/identifier-
> slug
>
>
> I have found very nice real example:
> http://www.mujmultimarket.cz/kategorie/elektronika/audio-video/audiosystemy/
>
>
> Thanks!! Tomas
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---