title: how to pass params using a route in Zend Framework 2?
body: <p>i have a router <code>test/view</code> and i would like to pass some params like <code>test/view/id/123</code>.</p>
  
  <p>Im not sure how to add those params in the zf2 router.</p>
  
  <pre><code>'router' =&gt; array(
          'routes' =&gt; array(
              'test' =&gt; array(
                  'type'    =&gt; 'Literal',
                  'options' =&gt; array(
                      'route'    =&gt; '/test',
                      'defaults' =&gt; array(
                          '__NAMESPACE__' =&gt; 'test\Controller',
                          'controller'    =&gt; 'Index',
                          'action'        =&gt; 'index',
                      ),
                  ),
                  'may_terminate' =&gt; true,
                  'child_routes' =&gt; array(
                      'view' =&gt; array(
                          'type' =&gt; 'Literal',
                          'options' =&gt; array(
                              'route' =&gt; '/view',
                              'defaults' =&gt; array(
                                  'controller' =&gt; 'Index',
                                  'action'     =&gt; 'view',
                              ),
                          ),
                      ),
                  ),
              ),
          ),
  ),
  </code></pre>
  
  <p>i setup <code>view</code> as a child route but not sure where to add those params.</p>
  
  <p>i've tried <code>'route' =&gt; '/view/:id/:value'</code> and </p>
  
  <pre><code>'defaults' =&gt; array(
      'controller' =&gt; 'Index',
      'action'     =&gt; 'view',
      'id'         =&gt; 'value',
  )
  </code></pre>
  
  <p>but they don't seem to work</p>
  
  <p>i am trying to understand how all this works.</p>
  
  <p>any ideas? thanks</p>