我是 Zend-Framework3 的新手。
并将我的 ZF2 应用程序迁移到 ZF3。
[:/action]
没有Actions
在控制器中调用。我们是否必须手动编写控制器中定义为路由的所有操作?
这是我的路由器module.config.php
'router' => array(
'routes' => array(
'user' => array(
'type' => 'segment',
'options' => array(
'route' => '/user[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+'
),
'defaults' => array(
'controller' => Controller\UserController::class,
'action' => 'login'
)
)
),
)
)
当我尝试/user/register
采取行动时。它生成404 error
.
我哪里错了?还是我必须手动注册所有操作?