Twig use语句失败," with ... as"声明

时间:2015-08-21 18:26:53

标签: twig

我有twig.js 0.8.2。当我尝试使用"使用"声明如下:

{% use "../../base/hello.twig " %}

导入文件没有任何问题,但如果hello.twig至少有一个块与当前块名称相同,我想改用它:

{% use "../../base/hello.twig " with content as parent-content %}

我的node.js服务器输出错误:

TwigException: Twig.expression.type.variable cannot follow a
Twig.expression.type.string at template:36 near 'with...'
Error parsing twig template views/parkers/hpi-check/nmr-help.twig:
TypeError: Cannot read property 'forEach' of undefined

有什么想法吗?谢谢。

1 个答案:

答案 0 :(得分:0)

我很确定,因为你的变量名中有一个减号,请尝试将其更改为下划线

相关问题