I have the following code using normal Zend routing and I need to convert it into Zend routing using XML:
$route = new Zend_Controller_Router_Route_Regex(
'test/v([0-9]+)-([0-9A-Za-z-:?&\'() ]+)\.html',
array(
'action' => 'someAction',
'controller' => 'someController'
),
array(
1 => video_id
),'test/v%d-%s.html');
$router->addRoute('some-Action', $route);
How can I pass parameters in XML and what is the basic syntax of this route in XML?
How’s this? You may want to add the second matched part to a variable too, though.
To use it, you can add it directly to your router: