我正在尝试在模板中包含一个模板,如下所示:
父母.tt
<div class="row-fluid">
<div class="span3">
[% INCLUDE my_sidebar]
</div><!--/span-->
</div>
my_sidebar.tt 与 parent.tt (/myapp/views) 存在于同一文件夹中
我对 config.yml 进行了以下更改:使用 ABSOLUTE
template: "template_toolkit"
engines:
template_toolkit:
encoding: 'utf8'
start_tag: '[%'
end_tag: '%]'
ABSOLUTE : 1
parent.tt 包含:
[% INCLUDE /myapps/views/my_sidebar %]
与相对
template: "template_toolkit"
engines:
template_toolkit:
encoding: 'utf8'
start_tag: '[%'
end_tag: '%]'
RELATIVE : 1
INCLUDE_PATH: /myapps/views
parent.tt 包含:
[% INCLUDE my_sidebar %]
但在这两种情况下,我都会收到以下错误:
core - template - file error - my_sidebar: not found at /.../csm/64-bit/cpan/5.16.1-2012.09/lib/Dancer/Template/Abstract.pm line 90.