ZF2: użycie pomocnika url i ponowne użycie parametrów zapytania
Usiłuję ponownie użyć params kwerendy za pomocą pomocnika Url w widoku. To jest mój obecny adres URL:
http://localhost/events/index?__orderby=name&__order=asc
Używam tego kodu w widoku:
$this->url('events/index', array('__page' => '2'), true);
Chcę uzyskać ten adres URL:
http://localhost/events/index?__orderby=name&__order=asc&__page=2
Ale zamiast tego dostaję to:
http://localhost/events/index?controller=Application\Controller\Events&__page=2
To jest moja trasa w pliku module.config.php:
'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',
),
),
),
Co ja robię źle? Dzięki za pomoc.