我正在尝试路由到我的控制器的编辑操作,但我没有成功。下面是我的module.config.php文件的内容。我正在使用 Zend 框架 2。我需要路由控制器中的每个操作吗?
<?php
return array(
'controllers' => array(
'invokables' => array(
'Manager\Controller\Index' => 'Manager\Controller\IndexController',
),
),
'router' => array(
'routes' => array(
'manager' => array(
'type' => 'Literal',
'options' => array(
// Change this to something specific to your module
'route' => '/manager',
'defaults' => array(
// Change this value to reflect the namespace in which
// the controllers for your module are found
'__NAMESPACE__' => 'Manager\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
// This route is a sane default when developing a module;
// as you solidify the routes for your module, however,
// you may want to remove it and replace it with more
// specific routes.
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'Manager' => __DIR__ . '/../view',
),
),
);