Class luci.dispatcher
Functions
| alias (...) | Create a redirect to another dispatching node. |
| 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 best possible strategy. |
| createindex_fastindex (path, suffix) | Generate the dispatching index using the fastindex C-indexer. |
| createindex_plain (path, suffix) | 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. |
| form (model) | Create a CBI form model dispatching target. |
| httpdispatch (request) | Dispatch an HTTP request. |
| modifier (func, order) | Register a tree modifier. |
| node (...) | Fetch or create a new dispatching node. |
| rewrite (n, ...) | Rewrite the first x path values of the request. |
| template (name) | Create a template render dispatching target. |
Functions
- alias (...)
-
Create a redirect to another dispatching node.
Parameters
- ...: Virtual path destination
- 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 best possible strategy.
- createindex_fastindex (path, suffix)
-
Generate the dispatching index using the fastindex C-indexer.
Parameters
- path: Controller base directory
- suffix: Controller file suffix
- createindex_plain (path, suffix)
-
Generate the dispatching index using the native file-cache based strategy.
Parameters
- path: Controller base directory
- suffix: Controller file suffix
- 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 - form (model)
-
Create a CBI form model dispatching target.
Parameters
- model: CBI form model tpo be rendered
- httpdispatch (request)
-
Dispatch an HTTP request.
Parameters
- request: LuCI HTTP Request object
- modifier (func, order)
-
Register a tree modifier.
Parameters
- func: Modifier function
- order: Modifier order value (optional)
- node (...)
-
Fetch or create a new dispatching node.
Parameters
- ...: Virtual path
Return value:
Dispatching tree node - 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