Wednesday, July 1, 2009

Re: Multiple prefixes and reverse prefix routing

I'm nearly there folks. My solution has been to modify the
'controller' part of my links in my views to include /venue/controller
and /admin/venue/controller. This works fine in the non admin links
i.e. /venue/controller/action/id - and partially works for admin i.e. /
admin/venue/controller - but as soon as I add on an id or something it
breaks i.e. /admin/venue/users/view/1 doesn't work but /admin/venue/
users does.

I get the error:
Error: VenueController could not be found.

Where Venue = the name of the venue - there actually is a venue
controller but I'm using generic terms here.

My routes currently look like this:
Router::connect('/venue', array('controller' => 'pages', 'action' =>
'display', 'venue_home', 'venue' => true));
Router::connect('/venue/pages/*', array('controller' => 'pages',
'action' => 'display', 'venue' => true));
Router::connect('/venue/:controller/:action/*', array('prefix' =>
'venue', 'venue' => true));
Router::connect('/admin/venue', array('controller' => 'pages',
'action' => 'display', 'admin_venue_home', 'admin_venue' => true));
Router::connect('/admin/venue/:controller/:action', array('prefix' =>
'admin_venue', 'admin_venue' => true));

Note I also have the builtin cake admin routes activated.

Any ideas anyone?
--~--~---------~--~----~------------~-------~--~----~
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: