0

该项目已从 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'
                    ],
                ]
            ];

'''

模块文件夹结构

4

1 回答 1

0

意识到我的错误,在我的移植过程中,另一个模块对 view_manager->template_path_stack 使用了相同的密钥标识符。我因为错过了这个而感到非常愚蠢。

于 2021-01-08T11:40:37.360 回答