我的生产服务器无法呈现我的登录布局。在我的开发系统上一切正常。
这是生产网站上的错误:
致命错误:未捕获 Zend\View\Exception\RuntimeException: Zend\View\Renderer\PhpRenderer::render: Unable to render template "layout/layoutlogin"
我是怎么做到的:
我Application/config/module.config.php
给出的模板如下:
'view_manager' => [
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => [
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'layout/layoutlogin' => __DIR__ . '/../view/layout/layoutlogin.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
],
'template_path_stack' => [
__DIR__ . '/../view',
],
],
在我的 Indexcontroller 中,我将布局设置为:
$this->layout()->setTemplate('layout/layoutlogin');
那可能会做我想要的!?在开发环境的开发模式下,我没有收到任何错误和警告。任何想法表示赞赏!