This blog is about the PHP solutions I have to think of when I'm developing systems almost every single day...

Thursday, April 24, 2008

Advanced routing in CakePHP

Wow.. routing in Cakephp is pretty good. Works both ways. To learn more go to:
http://debuggable.com/posts/new-router-goodies:480f4dd6-4d40-4405-908d-4cd7cbdd56cb

The most important part for me in the post was the past variable. Finally I'd be able to pass variables to the function. So for something like:


Router::connect('/:committee/:controller/:action/:id',array(),array('pass'=>array('committee','id')));

The empty array means you want to just pass to the default controller and action you keyed into the url. The pass array means you want to pass the committee as the first variable of the action and id as the second variable. Pretty cool stuff.

0 comments:

About Me

My Photo
Abdullah Zainul Abidin
I am what I am because of what I am...
View my complete profile