|
|||
|
On my main index page, there is a blurb of text that describes a client. Currently, if you want to see client 38, you would use this url
http://www.domain.com/index/index/client/38 However, I would prefer if the url could be shorter, like this http://www.domain.com/client/38 I know that I have to add a custom route, but I am not sure where to start. |
|
|||
|
I can give an untested idea based on index/client/38, should be easy to modify it to work with your situation. This doesn't mean its the best way to go, just a suggestion.
In bootstrap you could do something like: Code:
$router = $controller->getRouter();
$router->addRoute(
'client',
new Zend_Controller_Router_Route('client/:id', array(
'controller' => 'index',
'action' => 'client'));
That should change http://url/index/client/38 to just http://url/client/38. 38 being an id. You can check the manual further, that specific routing concept is under Zend_Controller, section 7.5.2. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|