2

我有一个使用 TT 获取视图的 Catalyst 应用程序: https ://metacpan.org/module/Catalyst::View::TT

我想试试https://metacpan.org/module/Catalyst::View::Xslate

我们将 WRAPPER 指令与 Template Toolkit 一起使用,我很好奇是否可以通过 xslate 以某种方式重用包装器,或者我是否必须将它们分解为页眉和页脚?

4

1 回答 1

1

You can in theory, by using TTerse syntax. According to the manual, enabling this allows you to use a lot of TT compatible code, including a simple WRAPPER statement.

However, there are caveats, as documented here. Given the philosophical differences between Xslate and TT, you might find it easier to bite the bullet and just rewrite your wrapper as header and footer Xslate code.

Or hold off on Xslate until your next project. Like horses, Templating engines are difficult to change mid-stream. :-)

于 2012-12-20T02:01:06.803 回答