错误意外关闭zend 2上的标记/content Mustache


Error Unexpected closing tag: /content Mustache on zend 2

我正在使用带有Zend框架2骨架应用程序的widmogrod/zf2胡子模块"dev-master"

在布局中,我有这样的代码:

{{$content}}{{/content}}

应该由每个控制器动作提供的实际内容来代替

我收到这个错误:

中的意外结束标记/contentvendor/mustach/mustache/Parser.php

它曾经使用phly/splash"dev-master"在Zend框架1上工作https://github.com/phly/phly-mustache

内容块在布局中应该是什么样子,为了能够正确加载Mustache,用控制器动作的实际内容替换内容?

在Mustache配置中,通过添加以下部分来启用Blocks Pragma:

'pragmas' => array(
        Mustache_Engine::PRAGMA_BLOCKS
    ),
'partials_loader' => array(
        dirname(__FILE__).'/../../layout', //directory for parent layout
        "extension" => ".phtml"
    )

在布局中,使用blocks pragma,通过在文件顶部添加以下部分:

{{% BLOCKS }}

在子模板扩展布局中,使用blocks pragma,预期如下:

{{% BLOCKS }}
{{< layout }}
{{$ content }}
    <div >
         New Content
    </div>
{{/ content }}
{{/ layout }}

然后,我需要修复BLOCKS pragma用法中的一个问题,该问题可在https://github.com/lebaz20/zf2-mustache-module并请求拉取位于的主库https://github.com/widmogrod/zf2-mustache-module/pull/9