I'm trying to reuse query params using Url helper in a view. This is my current url:
http://localhost/events/index?__orderby=name&__order=asc
I'm using this code in the view:
$this->url('events/index', array('__page' => '2'), true);
I want to obtain this url:
http://localhost/events/index?__orderby=name&__order=asc&__page=2
But instead i get this:
http://localhost/events/index?controller=Application\Controller\Events&__page=2
This is my route inside module.config.php file:
'events' => array(
'type' => 'segment',
'options' => array(
'route' => '/eventos[/:action]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
'controller' => 'Application\Controller\Events',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'index' => array(
'type' => 'Query',
),
),
),
What am i doing wrong? Thanks for your help.