I'm making a site for an artist and when showing image galleries of
art collections I want url's like

www.site.com/collections/name-of-collection

Now I also have a database table for collections, and hence a
collection_controller and a collection model.

First I had my routes like this
- Router::connect('/collections/:action/*', array('controller' =>
'collections'));
- Router::connect('/collections/*', array('controller' =>
'collections', 'action' => 'index'));

I thought that the first route would only catch url's with existing
actions, but instead it also caught my "/collections/name-of-
collection" url's. So I changed it to:

- Router::connect('/coll/:action/*', array('controller' =>
'collections'));

since the url's don't matter for my admin actions. But then I have to
change my forms because

<?= $form->create('Collection');?>

will post the form to /collections/...

Now I can solve this in several ways (change the model name; make
separate routes for all my admin actions, ...) but I was wondering if
there's an elegant way to deal with custom url's that start with a
controller/model name?
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to