Adding parameters to URL in ZF2 <p><br> I am trying to construct url which looks like this:</p> <pre><code> abc.com/folder?user_id=1&amp;category=v </code></pre> <p>Followed the suggestion given in this link:</p> <p><a href="http://stackoverflow.com/questions/12785190/how-can-you-add-query-parameters-in-the-zf2-url-view-helper">How can you add query parameters in the ZF2 url view helper</a></p> <p>Initially, it throws up this error</p> <pre><code> Query route deprecated as of ZF 2.1.4; use the "query" option of the HTTP router\'s assembling method instead </code></pre> <p>Following suggestion, I used similar to </p> <pre><code> $name = 'index/article'; $params = ['article_id' =&gt; $articleId]; $options = [ 'query' =&gt; ['param' =&gt; 'value'], ]; $this-&gt;url($name, $params, $options); </code></pre> <p>Now, I am getting syntax error saying, </p> <pre><code> Parse error: syntax error, unexpected '[' in /var/www/test/module/Dashboard/view/dashboard/dashboard/product.phtml on line 3 </code></pre> <p>My module.config.php is configured like this:</p> <pre><code> 'browse_test_case' =&gt; array( 'type' =&gt; 'Literal', 'options' =&gt; array( 'route' =&gt; '/browse-case[/:productId]', 'defaults' =&gt; array( 'controller' =&gt; 'Test\Controller\Browse', 'action' =&gt; 'browse-test-case', ), ), 'may_terminate' =&gt; true, 'child_routes' =&gt; array( 'query' =&gt; array( 'type' =&gt; 'Query', ), ), ), </code></pre> <p>Any Idea, please help!</p>