diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-04-05 21:58:41 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-04-05 23:03:01 +0200 |
commit | 7b04d0bbcf0f34393f20ccad8884a67fea9e2863 (patch) | |
tree | 9ac67fcae6992f5350e7c508e98baa741c402056 /modules/luci-base/luasrc/dispatcher.luadoc | |
parent | bc3651ba56b1c670beec6eaa879a4c28c5c96dc1 (diff) |
luci-base: introduce luci.dispatcher.lookup()
The lookup function takes multiple, possibly malformed path fragments,
splits them on slashes, constructs a temporary path and looks up the
result in the dispatch tree.
If a matching node has been found, the function will return both the
node reference and the canonical url to it.
If no corresponding node is found, the function returns nil.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/dispatcher.luadoc')
-rw-r--r-- | modules/luci-base/luasrc/dispatcher.luadoc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.luadoc b/modules/luci-base/luasrc/dispatcher.luadoc index 743463c74..ddf534b3e 100644 --- a/modules/luci-base/luasrc/dispatcher.luadoc +++ b/modules/luci-base/luasrc/dispatcher.luadoc @@ -116,8 +116,8 @@ Create a new dispatching node and define common parameters. ---[[ Fetch or create a dispatching node without setting the target module or - enabling the node. + @class function @name get @param ... Virtual path @@ -134,6 +134,15 @@ Fetch or create a new dispatching node. ]] ---[[ +Lookup node in dispatching tree. + +@class function +@name lookup +@param ... Virtual path +@return Node object, canonical url or nil if the path was not found. +]] + +---[[ Alias the first (lowest order) page automatically |