luci-base: expose luci.dispatcher.build_url() as url() in templates
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Oct 2015 11:03:42 +0000 (13:03 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Oct 2015 11:03:42 +0000 (13:03 +0200)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
modules/luci-base/luasrc/dispatcher.lua

index 28dfd18bbef57ab45d89157b3c8ffc64ea9b32a4..5d9d1b0b1a5eaa9e7682f1fe51dda057ae768e88 100644 (file)
@@ -286,6 +286,7 @@ function dispatch(request)
                   ifattr      = function(...) return _ifattr(...) end;
                   attr        = function(...) return _ifattr(true, ...) end;
                   token       = ctx.urltoken.stok;
+                  url         = build_url;
                }, {__index=function(table, key)
                        if key == "controller" then
                                return build_url()