How to create routes for component actions?
Notice: This thread is very old.
- pg
- Member | 8
You can do it by adding parameters to the route with names used in the query.
new Route("//<presenter>.<domainName>.<tld>/<do>/<tool-exampleId>/","Presenter:action");
// should generate urls like: presenter.example.com/tool-example/3/
To get rid of prefix “tool”, which is, I suppose, the component name, use Route::FILTER_TABLE.
new Route("//<presenter>.<domainName>.<tld>/<do>/<tool-exampleId>/",array(
"presenter"=>"Presenter",
// ... other options
"do"=>array(
Route::VALUE => NULL, // no default value
Route::FILTER_TABLE => array(
"example"=>"tool-example",
// and other translations ...
),
),
));
// should generate urls like: presenter.example.com/example/3/
It should work, but there could be some minor adjustments to make.
Last edited by pg (2012-08-26 17:30)