<< Google posting errors are a pain, the posts usually go through and I
apologise in advance if this is a duplicate post >>
Hi x0rster,

I hope I can add some clarity :)

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

This route says that the second parameter in the url is named "action"
with a DEFAULT of index. As pointed out by  Schinki this route is
redundant as this is what cake does anyway.
So, using this route =>
/blog/ == blog controller index method
/blog/history/ = blog controller history method
/blog/test/ = blog controller test method

If you search around the group you will find a comment from Nate to the
effect of "consider routes as regex predicates". What does that mean?

If you define these routes in this order:
$Route->connect ('/blog/*', array('controller'=>'Blog',
'action'=>'index'));
$Route->connect ('/blog/history/*, array('controller'=>'Blog',
'action'=>'history'));

the History route is irrelavent, because the blog/* route captures
everything.

If you define these routes in this order:
$Route->connect ('/blog/history/*, array('controller'=>'Blog',
'action'=>'history'));
$Route->connect ('/blog/*', array('controller'=>'Blog',
'action'=>'index'));

IFF the url begins with /blog/history/ your history aAction will be
called and in all other (blog) urls the index will be run.

I did this in the past (although running 1.2), so I hope the
information is accurate, if not I´m sure someone will correct me ;).
There is another solution if this doesn´t work by overriding the way
errors are handled, but that is perhaps a bit too involved, so I want
go into unnecessary details.
Cheers,

AD7six


--~--~---------~--~----~------------~-------~--~----~
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