【发布时间】:2011-06-06 16:51:25
【问题描述】:
所以我在尝试导入函数并在我的 cheetah 模板中运行它们时遇到了一些麻烦。
所以我有一个位于 /docroot/tmpl/base.html 的文件 然后是另一个文件 /docroot/tmpl/cmets.html
在 cmets 内部我有一些看起来像这样的东西
#def generateComments($commentObj):
code for generating comments
#end def
然后在base.html里面我想要这样的语法
#import docroot.tmpl.comments as comments
<div class="commentlist">
$comments.generateComments($commentObj)
</div>
但是,当我运行该输出时,我只会打印出 cmets.html 的内容,包括原始 txt 中的 #def generateComments。'
我错过了什么?
【问题讨论】: