具有子方法路由的zend框架2段路由

时间:2015-12-12 12:23:19

标签: php zend-framework

我正在尝试使用子方法路由配置段路由。但得到了一条异常消息"缺少参数" id""。无法找到错误的原因。请帮助。

'admin-pages-edit' => array(
    'type' => 'Zend\Mvc\Router\Http\Segment',
        'options' => array(
            'route' => '/admin/pages/edit/:id',
            'constraints' => array(
                'id' => '[1-9][0-9]*',
            ),
        ),
        'child_routes' => array(
            'admin-pages-edit-get' => array(
                'type' => 'Zend\Mvc\Router\Http\Method',
                'options' => array(
                    'verb' => 'get',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Module\Controller',
                        'controller'    => 'AdminPages',
                        'action'        => 'editGet',
                    ),
                ),
            ),
            'admin-pages-edit-post' => array(
                'type' => 'Zend\Mvc\Router\Http\Method',
                'options' => array(
                    'verb' => 'post',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Module\Controller',
                        'controller'    => 'AdminPages',
                        'action'        => 'editPost',
                    ),
                ),
            ),
        ),
    ),

0 个答案:

没有答案