gluon-web: add view helper for JSON-encoded values

Can be used for inserting Lua values into inline JS code.
This commit is contained in:
Matthias Schiffer 2018-08-18 13:56:00 +02:00
parent 897ee73d14
commit a2be178ce8
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -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 }))