I want to create seo friendly urls in my Zend Framework application but how is the correct syntax for this:
$newsroute = new Zend_Controller_Router_Route(
'news/:action/:id_:title',
array( 'controller' => 'news' ));
:id_:title obviously doesn’t work since Zend didn’t know that _ is a separator? Do i need to use the regex router for this or does it work with the normal one too?
Indeed a regex route would do the thing.
If for any reason you don’t want to use the regex route, there is a simple workaround via a front controller plugin:
Of course you can also extract the title the same way if you need it.
Don’t forget to build your ‘article’ param when you want to generate urls: