Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zend framework2 zf2应用程序未进入视图文件_Zend Framework2 - Fatal编程技术网

Zend framework2 zf2应用程序未进入视图文件

Zend framework2 zf2应用程序未进入视图文件,zend-framework2,Zend Framework2,我的zf2应用程序中有一个奇怪的问题,我无法处理它。 我已经拿到了我的模块认证。在这个模块中,我有控制器AuthController和动作登录。 为了让它更容易,让我们假设这个动作是空的。只有返回数组部分。 现在在module.config.php中 'view_manager' => array( 'display_not_found_reason' => true, 'display_exceptions' => true, 'doctype' =&

我的zf2应用程序中有一个奇怪的问题,我无法处理它。 我已经拿到了我的模块认证。在这个模块中,我有控制器AuthController和动作登录。 为了让它更容易,让我们假设这个动作是空的。只有返回数组部分。 现在在module.config.php中

'view_manager' => array(
    'display_not_found_reason' => true,
    'display_exceptions' => true,
    'doctype' => 'HTML5',
    'encode' => 'UTF-8',
    'not_found_template' => 'error/404',
    'exception_template' => 'error/index',
    'template_map' => array(
        'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
        'error/404' => __DIR__ . '/../view/error/404.phtml',
        'error/index' => __DIR__ . '/../view/error/index.phtml',
    ),
    'template_path_stack' => array(
        'auth' => __DIR__ . '/../view',
    ),
),
对于布局,一切都很好,我看到了它包含的所有内容。但应用程序不会进入视图文件view/auth/auth/login。 此外,如果我删除view/auth/auth/login文件,应用程序仍然显示布局,并且没有错误。看起来它不想阅读任何视图。。。 猜猜看


啊哈,我忘了添加我将模具放在这个动作上,并且这个模具显示正确

我猜您的布局文件缺少一行,无法响应内部视图模型内容:

<?=$this->content?>

举一个完整的例子,请查看骨架应用程序中的布局文件:

如果您找到了解决方案,请发布问题的答案,以便其他用户知道问题已经解决。