Class luci.dispatcher

Functions

_ () No-op function used to mark translation entries for menu labels.
alias (...) Create a redirect to another dispatching node.
arcombine (trg1, trg2) Create a combined dispatching target for non argv and argv requests.
assign (path, clone, title, order) Clone a node of the dispatching tree to another position.
build_url (...) Build the URL relative to the server webroot from given virtual path.
call (name, ...) Create a function-call dispatching target.
cbi (model) Create a CBI model dispatching target.
createindex () Generate the dispatching index using the native file-cache based strategy.
createtree () Create the dispatching tree from the index.
dispatch (request) Dispatches a LuCI virtual path.
entry (path, target, title, order) Create a new dispatching node and define common parameters.
error404 (message) Send a 404 error code and render the "error404" template if available.
error500 (message) Send a 500 error code and render the "error500" template if available.
firstchild () Alias the first (lowest order) page automatically
form (model) Create a CBI form model dispatching target.
get (...) Fetch or create a dispatching node without setting the target module or enabling the node.
httpdispatch (request) Dispatch an HTTP request.
lookup (...) Lookup node in dispatching tree.
node (...) Fetch or create a new dispatching node.
node_childs (node) Return a sorted table of visible children within a given node
node_visible (node) Check whether a dispatch node shall be visible
rewrite (n, ...) Rewrite the first x path values of the request.
template (name) Create a template render dispatching target.
translate (text) Access the luci.i18n translate() api.


Functions

_ ()
No-op function used to mark translation entries for menu labels. This function does not actually translate the given argument but is used by build/i18n-scan.pl to find translatable entries.
alias (...)
Create a redirect to another dispatching node.

Parameters

  • ...: Virtual path destination
arcombine (trg1, trg2)
Create a combined dispatching target for non argv and argv requests.

Parameters

  • trg1: Overview Target
  • trg2: Detail Target
assign (path, clone, title, order)
Clone a node of the dispatching tree to another position.

Parameters

  • path: Virtual path destination
  • clone: Virtual path source
  • title: Destination node title (optional)
  • order: Destination node order value (optional)

Return value:

Dispatching tree node
build_url (...)
Build the URL relative to the server webroot from given virtual path.

Parameters

  • ...: Virtual path

Return value:

Relative URL
call (name, ...)
Create a function-call dispatching target.

Parameters

  • name: Target function of local controller
  • ...: Additional parameters passed to the function
cbi (model)
Create a CBI model dispatching target.

Parameters

  • model: CBI model to be rendered
createindex ()
Generate the dispatching index using the native file-cache based strategy.
createtree ()
Create the dispatching tree from the index. Build the index before if it does not exist yet.
dispatch (request)
Dispatches a LuCI virtual path.

Parameters

  • request: Virtual path
entry (path, target, title, order)
Create a new dispatching node and define common parameters.

Parameters

  • path: Virtual path
  • target: Target function to call when dispatched.
  • title: Destination node title
  • order: Destination node order value (optional)

Return value:

Dispatching tree node
error404 (message)
Send a 404 error code and render the "error404" template if available.

Parameters

  • message: Custom error message (optional)

Return value:

false
error500 (message)
Send a 500 error code and render the "error500" template if available.

Parameters

  • message: Custom error message (optional)#

Return value:

false
firstchild ()
Alias the first (lowest order) page automatically
form (model)
Create a CBI form model dispatching target.

Parameters

  • model: CBI form model tpo be rendered
get (...)
Fetch or create a dispatching node without setting the target module or enabling the node.

Parameters

  • ...: Virtual path

Return value:

Dispatching tree node
httpdispatch (request)
Dispatch an HTTP request.

Parameters

  • request: LuCI HTTP Request object
lookup (...)
Lookup node in dispatching tree.

Parameters

  • ...: Virtual path

Return value:

Node object, canonical url or nil if the path was not found.
node (...)
Fetch or create a new dispatching node.

Parameters

  • ...: Virtual path

Return value:

Dispatching tree node
node_childs (node)
Return a sorted table of visible children within a given node

Parameters

  • node: Dispatch node

Return value:

Ordered table of child node names
node_visible (node)
Check whether a dispatch node shall be visible

Parameters

  • node: Dispatch node

Return value:

Boolean indicating whether the node should be visible
rewrite (n, ...)
Rewrite the first x path values of the request.

Parameters

  • n: Number of path values to replace
  • ...: Virtual path to replace removed path values with
template (name)
Create a template render dispatching target.

Parameters

  • name: Template to be rendered
translate (text)
Access the luci.i18n translate() api.

Parameters

  • text: Text to translate

Valid XHTML 1.0!