Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 带有子路由的ZF2分页器问题_Php_Pagination_Zend Framework2 - Fatal编程技术网

Php 带有子路由的ZF2分页器问题

Php 带有子路由的ZF2分页器问题,php,pagination,zend-framework2,Php,Pagination,Zend Framework2,在我的应用程序中,我想添加一些简单的分页。正常的第一级路由功能没有任何问题,但当我尝试在子路由中实现分页器时,会收到错误消息。我不知道如何正确地称呼我的孩子 我有以下路线: 'queues' => array( 'type' => 'Literal', 'options' => array( 'route' => '/queues', 'defaults' => array( 'contr

在我的应用程序中,我想添加一些简单的分页。正常的第一级路由功能没有任何问题,但当我尝试在子路由中实现分页器时,会收到错误消息。我不知道如何正确地称呼我的孩子

我有以下路线:

'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',
                ),
            ),
        ),
    )
)
这里是
.phtml
文件中的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()
    )
);
不幸的是,我遇到了以下错误:

文件:
/home/norbert/dev/holding/effeedback\u mail/vendor/zendframework/zend mvc/src/Router/Http/TreeRouteStack.php:322

消息:
名为“show”的路由没有子路由

当我尝试给出没有斜线的路线时:

array(
    'route' => 'queues/show', $this->queue->getId()
)
我得到这个段错误:

文件:
/home/norbert/dev/holding/effeedback\u mail/vendor/zendframework/zend mvc/src/Router/Http/Segment.php:298

消息:
缺少参数“队列id”


你可以找到你的答案哦,谢谢,我自己找不到。我来看看