projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44cd848
)
libs/web: add export() to template namespace, allows templates to export symbols...
author
Jo-Philipp Wich
<jow@openwrt.org>
Fri, 15 Oct 2010 16:12:07 +0000
(16:12 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Fri, 15 Oct 2010 16:12:07 +0000
(16:12 +0000)
libs/web/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index b79fdd38b98d7b1da55b5fc8a614b8513618fe54..8d5c02e607297d8b175a3f8fda99ae7190d166b7 100644
(file)
--- a/
libs/web/luasrc/dispatcher.lua
+++ b/
libs/web/luasrc/dispatcher.lua
@@
-237,6
+237,7
@@
function dispatch(request)
write = luci.http.write;
include = function(name) tpl.Template(name):render(getfenv(2)) end;
translate = function(...) return require("luci.i18n").translate(...) end;
+ export = function(k, v) if tpl.context.viewns[k] == nil then tpl.context.viewns[k] = v end end;
striptags = util.striptags;
pcdata = util.pcdata;
media = media;