-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone1的讨论 #2
Comments
必要的函数应该是在Runtime下实现,但应该是带着namespace的, 类似 Etag\Runtime\op_add。 用+替代~, 从兼容旧版的角度来看,不建议进行。 list作用域 这个觉得不错。 缩写表达式来简化 HTML标签 和 View数据绑定还没看,了解中:) |
支持宏不错 |
支持宏是什么呀? |
Macro looks like follows.
I've no idea about the schema of i18n now, Lol |
明白了。这个在twig里面用这种形式: {%macro SayHello(target)%}
{{"Hello"~target}}
{%endmacro%} 其实和sass中@mixin属同样概念 |
了解 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
例如
{{a+b}}
转换到etag_add(a,b)
而不是((a)+(b))
。好处是可以直接实现ab为字符串时的连接行为,无需增加新的字符串concat符。(在其它模板引擎中使用~来做字符串连接)。覆盖的问题会增加函数开销,导致解释结果的性能下降。例如1中的etag_add,是否直接在Runtime实现并作为一个全局函数?
下面是参考其它模板引擎的一些比较有趣的feature,看看是否有必要在后续考虑引入:
以jade为代表的依靠缩写表达式来节约html的冗余性。以slim举例:
结果将是
list作用域
类似Handlebars可以这样使用.
{{#list people}}{{firstName}} {{lastName}}{{/list}}
等同于
{{people.firstName}} {{people.lastName}}
View的数据绑定与共享传递
在laravel中可以对View绑定数据提供者,以此实现MVC。还可以让视图之间做数据传递(可以解决之前专题组件的联动更新问题?)。
The text was updated successfully, but these errors were encountered: