JavaScript模板引擎 jSmart

fmms 12年前
     <p>jSmart 是著名的 PHP 模板引擎 Smarty 的 JavaScript 移植版本。<br /> <br /> <a href="/misc/goto?guid=4958191033826918333" target="_blank"></a></p>    <p>示例模板:</p>    <pre class="brush:javascript; toolbar: true; auto-links: false;"><script id="test_tpl" type="text/x-jsmart-tmpl">     <h1>{$greeting}</h1>     {foreach $books as $i => $book}        <div style="background-color: {cycle values="cyan,yellow"};">           [{$i+1}] {$book.title|upper} by {$book.author}               {if $book.price}                                                 Price: <span style="color:red">${$book.price}</span>              {/if}                                                   </div>     {foreachelse}        No books     {/foreach}     Total: {$book@total}  </script></pre>    <p></p> 项目地址:    <a href="/misc/goto?guid=4958197350211477165" target="_blank">http://code.google.com/p/jsmart/</a>    <br />    <br />    <a href="/misc/goto?guid=4958191033826918333" target="_blank"><span style="font-weight:bold;">smarty</span></a>是一个基于PHP开发的PHP模板引擎。它提供了逻辑与外在内容的分离,简单的讲,目的就是要使 用PHP程序员同美工分离,使用的程序员改变程序的逻辑内容不会影响到美工的页面设计,美工重新修改页面不会影响到程序的程序逻辑,这在多人合作的项目中 显的尤为重要。