How can you add query parameters in the ZF2 / ZF3 url view helper

Since version 2.1.4 you come across user error

Query route deprecated as of ZF 2.1.4; use the “query” option of the HTTP router\’s assembling method instead

Usage example:

$name="index/article";
$params  = ['article_id' => $articleId];
$options = [
        'query' => ['param' => 'value'], 
    ];
$this->url($name, $params, $options);

Leave a Comment