Laravel在{%content%}中显示信息

时间:2017-01-29 13:19:07

标签: php laravel twig octobercms

显示内容块信息有问题

{% content 'structurated/'this.page.filename %}

这会返回错误。如果我删除'structurated/' {% content this.page.filename %}它正在运行并返回内容块。但我需要从structurated/文件夹中返回信息。如何更改可行的代码?

{% content 'structurated/'this.page.filename %}

ERROR:
Unexpected token "punctuation" of value "." ("operator" expected with value "=").
==========
{% content 'structurated/'.this.page.filename %}

An exception has been thrown during the rendering of a template ("The content file '' is not found.").
==========
{% content 'structurated/'+this.page.filename %}

An exception has been thrown during the rendering of a template ("The content file '0' is not found.").

1 个答案:

答案 0 :(得分:1)

这应该这样做。

{% content 'structurated/' ~ this.page.filename %}

现在没有正确连接