在我的模块的module.config.php中,我有类似的东西:
'controllers' => [
'factories' => [
Controller\MainappController::class =>
Controller\Factory\MainappControllerFactory::class,
//...
Controller\VoucherController::class =>
Controller\Factory\VoucherControllerFactory::class,
//...
],
],
'router' => [
'routes' => [
'mainapp' => [
'type' => Segment::class,
'options' => [
'route' => '/mainapp[/:action[/:first_id][/:second_id]]',
'constraints' => [
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
],
'defaults' => [
'controller' => Controller\MainappController::class,
'action' => 'index',
],
],
],
'voucher' => [
'type' => Segment::class,
'options' => [
'route' => '/voucher[/:action[/:first_id][/:second_id]]',
'constraints' => [
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
],
'defaults' => [
'controller' => Controller\VoucherController::class,
'action' => 'index',
],
],
],
],
],
凭证是同一模块中的新控制器
我可以转到public/mainapp
,
但是当我尝试public/voucher
我有错误
发现404错误页面未找到。
路由无法匹配请求的网址。
请告诉我这个配置有什么问题。