In my application I want to add some simple pagination. Normal first level routes function without any problems but when I try to implement a paginator in a child route I get error messages. Don't know how to address my child route correctly.
I have following routes:
'queues' => array(
'type' => 'Literal',
'options' => array(
'route' => '/queues',
'defaults' => array(
'controller' => 'Mail\Controller\MailQueue',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'show' => array(
'type' => 'Segment',
'options' => array(
'route' => '/show/:queue_id',
'constraints' => array(
'queue_id' => '[0-9]+',
),
'defaults' => array(
'action' => 'show',
),
),
),
)
)
And here the paginationControl from the .phtml
file to output the pagination html:
echo $this->paginationControl(
// the paginator object
$this->paginator,
// the scrolling style
'sliding',
// the partial to use to render the control
'partial/paginator.phtml',
// the route to link to when a user clicks a control link
array(
'route' => 'queues/show/' . $this->queue->getId()
)
);
Unfortunately, I get this error:
File:
/home/norbert/dev/holding/efeedback_mail/vendor/zendframework/zend-mvc/src/Router/Http/TreeRouteStack.php:322Message:
Route with name "show" does not have child routes
When I try to give it the route without the slash:
array(
'route' => 'queues/show', $this->queue->getId()
)
I get this segment error:
File:
/home/norbert/dev/holding/efeedback_mail/vendor/zendframework/zend-mvc/src/Router/Http/Segment.php:298Message:
Missing parameter "queue_id"