I'm having an issue with zendframework routes and params.
I have language selector in my view page:
<div class="language-chooser"> <? $params = Zend_Controller_Front::getInstance()->getRequest()->getParams(); unset($params['module']); unset($params['controller']); unset($params['action']); ?> <a href="<?= $this->url(array_merge($params, array('lang' => 'pt'))); ?>"><img src="<?= $this->baseUrl('/images/flags/br.png'); ?>" alt="" /></a> <a href="<?= $this->url(array_merge($params, array('lang' => 'en'))); ?>"><img src="<?= $this->baseUrl('/images/flags/us.png'); ?>" alt="" /> </a> </div> It works fine without routes. Accessing localhost/app/contact, I get the link correctly Ex.: localhost/app/contact/index/lang/en
But if I add a route
protected function _initRotas() { $router = Zend_Controller_Front::getInstance()->getRouter(); $route = new Zend_Controller_Router_Route( '/contact', array( 'module' => 'default', 'controller' => 'contact', 'action' => 'index' ) ); $router->addRoute('contact', $route); } I get the link without the lang param. Ex.: localhost/app/contact/
How could i solve this issue?
Thanks