xslate/Catalyst::View::Xslate wrapper

好久不见. 提交于 2019-12-12 17:10:04

问题


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

and I would like to try out https://metacpan.org/module/Catalyst::View::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?


回答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. :-)



来源:https://stackoverflow.com/questions/13962769/xslate-catalystviewxslate-wrapper

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!