I\'m attempting to create a url with a query string using a route, like so:
$this->url(\'users\') -> /users
$this->url(\'users\', [\'sort\' => \'
You can create a child route for your users route like this:
'users' => array(
'type' => 'Literal',
'options' => array(
'route' => '/users',
'defaults' => array(
'__NAMESPACE__' => 'User\Controller',
'controller' => 'Index',
'action' => 'list',
),
),
'may_terminate' => true,
'child_routes' => array(
'query' => array(
'type' => 'Query',
),
),
),
then you can assemble $this->url('users/query', array('sort' => 'desc'))
.
Don't forget to set may_terminate
to true
!