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