flowpack / mustache
Mustache 模板融合对象
0.0.1
2020-05-05 17:55 UTC
Requires
- mustache/mustache: ^2.0
- neos/flow: ^4.0|^5.0|^6.0
This package is auto-updated.
Last update: 2024-08-29 05:30:41 UTC
README
有偏见的 Mustache 模板。
TL;DR
composer require flowpack/mustache
- 继承模板对象,将模板变量设置为键
prototype(Your.Site:Hello) < prototype(Flowpack.Mustache:Template) {
planet = 'Earth'
}
-
将 Mustache 模板放置在
Packages/Sites/Your.Site/Resources/Private/Fusion/Hello/Hello.html
。例如:Hello, {{planet}}
-
或者您可以用它作为 Eel 辅助函数,例如:
@process.params = ${Mustache.render('Hello, {{planet}}', {planet: 'Earth'})}
。在替换内容中的某些占位符时很有用。