Hi,

I have a few controllers, Pages (custom),News,Reports etc and on the
front end I'd like to loose the method names from my URLs, eg:

www.mydomain.com/news/category/category_name
becomes
www.mydomain.com/news/category_name

and

www.mydomain.com/news/article/article_name
becomes
www.mydomain.com/news/category_name/article_name

I have this working fine for some controllers using the following route:

$Route->connect ('/news/*', array('controller' => 'news', 'action' => 'index'));

Where I'm coming unstuck is with my Pages controller. Each page
belongs to a category, and I'm using a url friendly version of the
categories name, followed by the same for the artlicles name within my
index function. This works fine if I use a route like so:

$Route->connect ('/pages/*', array('controller' => 'news', 'action' =>
'index'));

with that I can do:

www.mydomain.com/pages/category_name/page_name

what I'm trying to do is loose the 'pages' part of the url, because
the category title signifies the seciton of the site (much in the same
way that 'news' or 'reports' does), and I like to keep things
uniformed.

I've since tried doing:

$Route->connect ('/who_we_are/', array('controller' => 'pages',
'action' => 'index','who_we_are'));
$Route->connect ('/who_we_are/*', array('controller' => 'pages',
'action' => 'index','who_we_are'));

but this only gives me one of the arguments from the URL, not both, eg
if I debug(func_get_args($this)) at the top of my index() method:

www.mydomain.com/who_we_are
gives me:
[0] => who_we_are

and

www.mydomain.com/who_we_are/company_history
gives me:
[0] => company_history

as you can see, 'who_we_are' has vanished from the url!

I'm not sure if what I'm attempting is possible or not, but I sure hope it is!

many thanks,

Jon

-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to