0

如何渲染动态内容块?

{% content 'variable.html' %}
  • 变量是要呈现的其他内容的占位符。

谢谢,

4

2 回答 2

1

尝试这样的事情:

//php section
public function onStart(){
    $this['some_content_variable'] = 'variable.htm';
}
==
{% content some_content_variable %}
于 2016-02-16T19:43:37.770 回答
0

如果您需要连接文件夹路径,这也适用:

{% content 'path/folder/' ~ some_content_variable ~ '.htm' %}

PS:如果你愿意,你可以省略'.htm'。

于 2016-12-02T14:04:07.580 回答