totally new to cakephp and really struggling to understand the docs.
Idea I'm working on is for a rental property search. I have controller rentalsController
In here I have index which I fetch all
I also have a sidebar which lists regions
Now, what I want to happen is for a user to view index and then go to sidebar and select a region they'd wish to rent from. The URL should be .com/rentals/region-name/
This will then call (could be wrong here) rentalsController > byRegion($region){ fetch.... )
How do I a) set-up routes to manage this and b) the function to gather that passed region.
Sorry if this basic but I've searched and now about to blow my mind - as you can imagine - we've all been here at one point learning a new way of doing things.
Thank you for all your feedback - Mark
EDIT
Finally got there:
Router::connect(
'/rentals-in-:region.html',
array( 'controller' => 'rentals', 'action' => 'byRegion' ),
array( 'region' => '[a-zA-Z0-9\-]+', 'pass' => array('region'),
));