From a2be178ce81461eefbf36e8c50a76b8ea3e6414c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 18 Aug 2018 13:56:00 +0200 Subject: [PATCH] gluon-web: add view helper for JSON-encoded values Can be used for inserting Lua values into inline JS code. --- package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua index b003a086..7f5b4c8b 100644 --- a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua +++ b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua @@ -87,6 +87,7 @@ local function dispatch(config, http, request) pcdata = util.pcdata, urlencode = proto.urlencode, attr = attr, + json = json.stringify, url = function(path) return build_url(http, path) end, }, { __index = _G }))