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