当更改应用程序模块的路径时,zf3 无法正常工作
下载一个zf3骨架应用程序,更改zf3的路由
'router' => [
'routes' => [
'home' => [
'type' => Literal::class,
'options' => [
'route' => '/',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
],
'application' => [
'type' => Segment::class,
'options' => [
'route' => '/application[/:action]',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
],
],
],
我将其更改为:
'router' => [
'routes' => [
'home' => [
'type' => Literal::class,
'options' => [
'route' => '/test',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
],
'application' => [
'type' => Segment::class,
'options' => [
'route' => '/testapplication[/:action]',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
],
],
],
当我访问 /test 和 /testapplication/index 时,出现 404 page not find 错误,看来 zf3 无法路由到此路径