libs/web: Added luci.web.dispatcher.registered
This commit is contained in:
parent
ced11a4a13
commit
3ca2844c9f
1 changed files with 14 additions and 0 deletions
|
@ -324,6 +324,20 @@ function entry(path, target, title, order)
|
||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Checks whether a node exists
|
||||||
|
function registered(...)
|
||||||
|
local c = context.tree
|
||||||
|
|
||||||
|
for k,v in ipairs(arg) do
|
||||||
|
if not c.nodes[v] then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
c = c.nodes[v]
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
-- Fetch a dispatching node
|
-- Fetch a dispatching node
|
||||||
function node(...)
|
function node(...)
|
||||||
local c = context.tree
|
local c = context.tree
|
||||||
|
|
Loading…
Reference in a new issue