Speed up generation of dispatching tree
This commit is contained in:
parent
53871726b5
commit
5cfda95377
1 changed files with 10 additions and 8 deletions
|
@ -449,17 +449,19 @@ end
|
|||
--- Create a template render dispatching target.
|
||||
-- @param name Template to be rendered
|
||||
function template(name)
|
||||
return function()
|
||||
require("luci.template")
|
||||
return function() luci.template.render(name) end
|
||||
luci.template.render(name)
|
||||
end
|
||||
end
|
||||
|
||||
--- Create a CBI model dispatching target.
|
||||
-- @param model CBI model tpo be rendered
|
||||
function cbi(model)
|
||||
return function(...)
|
||||
require("luci.cbi")
|
||||
require("luci.template")
|
||||
|
||||
return function(...)
|
||||
local stat, maps = luci.util.copcall(luci.cbi.load, model, ...)
|
||||
if not stat then
|
||||
error500(maps)
|
||||
|
@ -485,10 +487,10 @@ end
|
|||
--- Create a CBI form model dispatching target.
|
||||
-- @param model CBI form model tpo be rendered
|
||||
function form(model)
|
||||
return function(...)
|
||||
require("luci.cbi")
|
||||
require("luci.template")
|
||||
|
||||
return function(...)
|
||||
local stat, maps = luci.util.copcall(luci.cbi.load, model, ...)
|
||||
if not stat then
|
||||
error500(maps)
|
||||
|
|
Loading…
Reference in a new issue