DotLiquid-Asp.net模板引擎

這裏先介紹一下它的幾個主要的概念:

 Filter:"Filters are simple methods(過濾器是一些簡單的方法)"

     如標準Filter中的upcase,{{ "looGn" | upcase }}  值爲"LOOGN"。

 Tag:"Tags are used for the logic in your template(標籤用於實現模板中的邏輯)"。

     如標準Tag中的assign,{% assign freestyle = false %} 定義值爲false的freestyle變量。

 Block:其實block也是tag,如if..else,for..in, 可以說Block是有endtag的Tag。

    如:{% for i in (1..5) %}

          {{ i }}

      {% endfor %}

原文:http://www.cnblogs.com/loogn/archive/2011/08/14/2138066.html

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章