Answer the question
In order to leave comments, you need to log in
Zend Framework Router?
Good afternoon!
Tell me how to write a router for a request like site.ru/id123 , where 123 is a variable number.
If you need site.ru/id/123 then this option works:
new Zend_Controller_Router_Route('id/:id', array('module' => 'default', 'controller' => 'user', 'action' => 'profile'))
new Zend_Controller_Router_Route('id:id', array('module' => 'default', 'controller' => 'user', 'action' => 'profile'))
Answer the question
In order to leave comments, you need to log in
Use routers based on regular expressions
Route("id/id(\d+)", array( 'module' => 'default', 'controller' => 'user', 'action' => 'profile', 1 => 'id' )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question