我想使用 ZfcAdmin 模块创建管理面板。我想创建路由,管理用户。就这个:
<?php
return array(
'controllers' => array(
'invokables' => array(
'AdminUser\Controller\AdminUser' => 'AdminUser\Controller\AdminUserController',
),
),
'view_manager' => array(
'template_path_stack' => array(
'admin-user' => __DIR__ . '/../view',
),
),
'router' => array(
'routes' => array(
'zfcadmin' => array(
'may_terminate' => true,
'child_routes' => array(
'user' => array(
'type' => 'segment',
'options' => array(
'route' => '/user',
'defaults' => array(
'controller' => 'AdminUser\Controller\AdminUser',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' =>array(
'edit' => array(
'type' => 'segment',
'options' => array(
'route' => '/edit/:user_id',
'defaults' => array(
'controller' => 'AdminUser\Controller\AdminUser',
'action' => 'edit',
),
),
),
),
),
),
),
),
),
);
我请求:/admin/user
没关系,但是当我想接收如下 URL 时:/admin/user/edit/1
我总是/admin/user
这样创建链接:
<?php $this->url('zfcadmin/user/edit', array(
'action' => 'edit',
'user_id' => $user['user_id'],
)) ?>
为什么?怎么了?