Go 模板引擎:pongo2

jopen 10年前發布 | 34K 次閱讀 pongo2 模板引擎

pongo 2 是一個語法與 Django 模板類似的 Go 語言模板引擎,并且完全兼容 Django 模板。pongo 2提供了復雜和嵌套函數調用和強大的類C表達式。

{% if user.is_moderator && (user.moderation_level > 2 || user.moderation_level <= 0) %}
   ...
{% else %}
   ...
{% endif %}

{% if (check_access("admin", userprofile.username) && userprofile.is_verified()) || admin_happyhour %} ... {% endif %}

{% if helper_functions.is_server_online("florian-schlachter.de") %}Server is up!{% endif %}

{{ make_statuscode_verbose( user.lang, make_http_request(server.url, "/index.php").statuscode) }}</pre>

項目主頁:http://www.baiduhome.net/lib/view/home/1404198271077

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!