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 28dfd18..5d9d1b0 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()