2017-04-07 33 views
2

我使用的是express.jstwig.js 0.9.5,我想爲每個模板中的所有變量啓用autoescape。我發現this頁面告訴它它應該在0.9.0默認啓用,但它似乎不起作用。除非另有說明,我如何配置樹枝以逃避一切?如何在twig.js中全局啓用autoescape?

回答

0

Express.js傳球無論是在twig options設置小枝,所以使所有視圖autoescape,用途:

var app = express(); 
app.set('twig options', { 
    autoescape: true 
}); 
+0

感謝的人,你是最棒的! – Fluffy

相關問題