我已经使用 Laminas MVC Skeleton Application 设置了一个基本应用程序。
我创建了一个具有以下结构的模块测试:
Test
|- config
| |- module.config.php
|- src
| |- Controller
| | |- IndexController.php
| |- Form
| |- Model
| |- Module.php
|- view
|- test
| |- index
| | |- index.phtml
索引控制器.php
<?php
namespace Test\Controller;
use Laminas\Mvc\Controller\AbstractActionController;
class IndexController extends AbstractActionController
{
public function indexAction()
{
}
}
view_manager 配置:
'view_manager' => [
'template_path_stack' => [
__DIR__ . '../view',
],
],
但我收到以下错误
Laminas\View\Renderer\PhpRenderer::render: Unable to render template "test/index/index"; resolver could not resolve to a file
我希望它在 /view/test/index 中搜索 index.phtml 模板,但找不到它。
如何解决这个问题?