Jinja2 テンプレート エンジンは初めてです。Zend Framework のビュー ヘルパーのようなものはありますか? 簡単な関数を作成して、すべてのテンプレート ファイルで再利用できますか?
このようなもの?
#somewhere in my python code:
def nice_demo_function(message):
""""return a simple message"""
return message
だから私はそれを使うことができます:
<!-- now in my template-file -->
{% nice_demo_function('yes, this works great!') %}