这两个服务器和客户机上的工作模板语言 [英] Template language that works on both server and client
问题描述
我要寻找一个模板解决方案可以同时在服务器端(如再培训局)的工作和客户端(如EJS),所以我没有写两次意见的使用,比方说,无论是Rails和<一个HREF =https://github.com/documentcloud/backbone>骨干。结果
想到的首先就是髭。任何其他人呢?结果
任何人都成功地这样做呢?
I am looking for a template solution that can work on both server side (like ERB) and client side (like EJS) so I don't have to write the views twice for use in, say, both Rails and Backbone.
The first that comes to mind is Mustache. Any others?
Anyone doing this successfully ?
修改
我把一个编译这里。
推荐答案
尝试胡子。 (微博用它在最近的重新设计,使他们能够共享服务器端的Ruby和客户端JavaScript之间的模板。)
Try Mustache. (Twitter used it in their recent redesign, so they can share templates between server-side Ruby and client-side JavaScript.)
这也是在Ruby中的JavaScript,Python和二郎,PHP,Perl中,Objective-C中的Java,.NET,Android的,C ++,围棋,Lua中,OOC,动作,ColdFusion的,Scala中,Clojure中,Fantom的,CoffeeScript的使用, D,和Node.js的。
It's also available in Ruby, JavaScript, Python, Erlang, PHP, Perl, Objective-C, Java, .NET, Android, C++, Go, Lua, ooc, ActionScript, ColdFusion, Scala, Clojure, Fantom, CoffeeScript, D, and for node.js.
(是的,我知道你在你的问题中提到,但是,这个答案有联系和东西。)
(Yes, I know you mentioned it in your question, but this answer has links and stuff.)
这篇关于这两个服务器和客户机上的工作模板语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!