2015-11-16 36 views
0

我使用widmogrod/zf2-mustache-module“DEV-主”与Zend框架2骨架应用错误意外关闭标签:上的Zend /内容髭2

在布局我有这样的代码:

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

这应该是由每个控制器动作提供的实际内容替换

我收到此错误:

Unexpected closing tag: /content in vendor/mustache/mustache/src/Mustache/Parser.php

它用来在Zend框架1工作使用PHLY /胡子“开发高手” https://github.com/phly/phly-mustache

内容分块应该怎么看起来像在布局中,为了能够正确加载小胡子,与更换内容的控制器操作的实际内容?

+1

您是否可以编辑您的帖子以实际包含问题? –

+0

完成,对不起,如果不清楚, –

回答

1

在髭配置,启用块附注,通过添加以下部分:

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

在布局,使用块编译,通过在文件的顶部添加以下部分:

{{% BLOCKS }} 

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

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

然后,我需要修复BLOCKS杂注使用情况中的问题https://github.com/lebaz20/zf2-mustache-module,并要求为主库吸取https://github.com/widmogrod/zf2-mustache-module/pull/9

+0

https://github.com/widmogrod/zf2-mustache-module现在更新与我的拉取请求合并, –