2
所以我嘗試導入函數並在我的獵豹模板中運行它們時遇到了一些麻煩。獵豹模板導入函數
所以我有一個文件,它住在/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。'
我錯過了什麼?