我是Jinja2模板引擎的新手。有没有像Zend Framework的视图助手?我可以创建简单的函数,并在所有模板文件中重复使用它们吗?Jinja2:寻找一个视图帮助者
这样的事情?
#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!') %}
全球性的事情是非常急需的,我需要...... – DerKlops 2010-07-12 13:19:23