【发布时间】:2015-04-17 23:34:08
【问题描述】:
在过去的 2 年里,我在所有项目中都使用 Meteor.js,但我接受了一个使用 PHP 的项目,但它仍然没有合适的模板引擎,它只使用简单的 include 和 php echos .
我真的很喜欢类似 mustache 的语法,但是真正让 Meteor.js 样式模板与众不同的是,它能够为每个模板帮助器运行 #each、#if/else 等帮助器函数,并且您可以定义多个每个文件的模板。
我想找到一个类似的模板引擎,以避免创建自己的。
通常,我在同一页面上设置许多小模板,就像这样:
<template name="post">
{{ user.name }} said :
{{> postTextTemplate }}
</template>
<template name="postTextTemplate">
{{ postText }}
<hr>
At {{ postDate }} - {{ postLikes }} likes.
</template>
谢谢。
【问题讨论】: