该项目已从 Zend Frame work 2 手动移植到 Laminas。这里的问题是 module.config.php 的设置方式与其他正在运行的模块相同。但是我遇到了这个错误。我检查了通常的罪魁祸首,例如文件拼写或丢失,没有其他模块使用相同的路由名称。Laminas 的另一部分是否会影响视图管理器?
modul.config.php 设置如下。
''' 命名空间 ProjectTaskDocument;
use Laminas\Router\Http\Segment;
return [
'router' => [
'routes' => [
'project-task-document' => [
'type' => Segment::class,
'options' => [
'route' => '/task-document[/:action][/:id]',
'constraints' => [
'action' => 'index|add|download|view-all|delete'
],
'defaults' => [
'controller' => Controller\ProjectTaskDocumentController::class,
'action' => 'index'
]
]
]
]
],
'view_manager' => [
'template_path_stack' => [
'ProjectTaskDocument' => __DIR__ . '/../view'
],
]
];
'''