xslate/Catalyst :: View :: Xslate包装器 [英] xslate/Catalyst::View::Xslate wrapper

查看:95
本文介绍了xslate/Catalyst :: View :: Xslate包装器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用TT进行查看的Catalyst应用程序: https://metacpan.org/module/Catalyst::View::TT

I have a Catalyst application that uses TT for views: https://metacpan.org/module/Catalyst::View::TT

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

我们在Template Toolkit中使用了WRAPPER指令,我很好奇是否有可能以某种方式用xslate重用包装器,还是我必须将它们分成页眉和页脚?

We use the WRAPPER directive with Template Toolkit and I am curious if it is at all possible to reuse the wrapper somehow with xslate or would I have to break them into headers and footers?

推荐答案

从理论上讲,您可以使用

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.

但是,有一些警告,如记录所示,这里.考虑到Xslate和TT之间在哲学上的区别,您可能会发现比较容易,只需将包装器重写为Xslate的页眉和页脚代码即可.

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.

或者推迟使用Xslate,直到下一个项目.像马一样,模板引擎很难在中游时进行更改. :-)

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

这篇关于xslate/Catalyst :: View :: Xslate包装器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆