luci/documentation/api/modules/luci.dispatcher.html
Jo-Philipp Wich 3d0e8deede Regenerate api documentation
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-09-01 16:44:59 +02:00

1151 lines
14 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../luadoc.css" type="text/css" />
<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<div id="navigation">
<h1>LuaDoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<!-- Module list -->
<h1>Modules</h1>
<ul>
<li><strong>luci.dispatcher</strong></li>
<li>
<a href="../modules/luci.http.html">luci.http</a>
</li>
<li>
<a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
</li>
<li>
<a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
</li>
<li>
<a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
</li>
<li>
<a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
</li>
<li>
<a href="../modules/luci.i18n.html">luci.i18n</a>
</li>
<li>
<a href="../modules/luci.ip.html">luci.ip</a>
</li>
<li>
<a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
</li>
<li>
<a href="../modules/luci.json.html">luci.json</a>
</li>
<li>
<a href="../modules/luci.jsonc.html">luci.jsonc</a>
</li>
<li>
<a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
</li>
<li>
<a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
</li>
<li>
<a href="../modules/luci.model.uci.html">luci.model.uci</a>
</li>
<li>
<a href="../modules/luci.rpcc.html">luci.rpcc</a>
</li>
<li>
<a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
</li>
<li>
<a href="../modules/luci.sys.html">luci.sys</a>
</li>
<li>
<a href="../modules/luci.sys.init.html">luci.sys.init</a>
</li>
<li>
<a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
</li>
<li>
<a href="../modules/luci.sys.net.html">luci.sys.net</a>
</li>
<li>
<a href="../modules/luci.sys.process.html">luci.sys.process</a>
</li>
<li>
<a href="../modules/luci.sys.user.html">luci.sys.user</a>
</li>
<li>
<a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
</li>
<li>
<a href="../modules/luci.util.html">luci.util</a>
</li>
<li>
<a href="../modules/nixio.html">nixio</a>
</li>
<li>
<a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
</li>
<li>
<a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
</li>
<li>
<a href="../modules/nixio.File.html">nixio.File</a>
</li>
<li>
<a href="../modules/nixio.README.html">nixio.README</a>
</li>
<li>
<a href="../modules/nixio.Socket.html">nixio.Socket</a>
</li>
<li>
<a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
</li>
<li>
<a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
</li>
<li>
<a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
</li>
<li>
<a href="../modules/nixio.bin.html">nixio.bin</a>
</li>
<li>
<a href="../modules/nixio.bit.html">nixio.bit</a>
</li>
<li>
<a href="../modules/nixio.crypto.html">nixio.crypto</a>
</li>
<li>
<a href="../modules/nixio.fs.html">nixio.fs</a>
</li>
</ul>
<!-- File list -->
</div><!-- id="navigation" -->
<div id="content">
<h1>Class <code>luci.dispatcher</code></h1>
<p></p>
<h2>Functions</h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_">_</a>&nbsp;()</td>
<td class="summary">
No-op function used to mark translation entries for menu labels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#alias">alias</a>&nbsp;(...)</td>
<td class="summary">
Create a redirect to another dispatching node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#arcombine">arcombine</a>&nbsp;(trg1, trg2)</td>
<td class="summary">
Create a combined dispatching target for non argv and argv requests.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#assign">assign</a>&nbsp;(path, clone, title, order)</td>
<td class="summary">
Clone a node of the dispatching tree to another position.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#build_url">build_url</a>&nbsp;(...)</td>
<td class="summary">
Build the URL relative to the server webroot from given virtual path.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#call">call</a>&nbsp;(name, ...)</td>
<td class="summary">
Create a function-call dispatching target.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#cbi">cbi</a>&nbsp;(model)</td>
<td class="summary">
Create a CBI model dispatching target.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#createindex">createindex</a>&nbsp;()</td>
<td class="summary">
Generate the dispatching index using the native file-cache based strategy.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#createtree">createtree</a>&nbsp;()</td>
<td class="summary">
Create the dispatching tree from the index.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#dispatch">dispatch</a>&nbsp;(request)</td>
<td class="summary">
Dispatches a LuCI virtual path.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#entry">entry</a>&nbsp;(path, target, title, order)</td>
<td class="summary">
Create a new dispatching node and define common parameters.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#error404">error404</a>&nbsp;(message)</td>
<td class="summary">
Send a 404 error code and render the "error404" template if available.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#error500">error500</a>&nbsp;(message)</td>
<td class="summary">
Send a 500 error code and render the "error500" template if available.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#firstchild">firstchild</a>&nbsp;()</td>
<td class="summary">
Alias the first (lowest order) page automatically
</td>
</tr>
<tr>
<td class="name" nowrap><a href="#form">form</a>&nbsp;(model)</td>
<td class="summary">
Create a CBI form model dispatching target.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get">get</a>&nbsp;(...)</td>
<td class="summary">
Fetch or create a dispatching node without setting the target module or
enabling the node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#httpdispatch">httpdispatch</a>&nbsp;(request)</td>
<td class="summary">
Dispatch an HTTP request.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modifier">modifier</a>&nbsp;(func, order)</td>
<td class="summary">
Register a tree modifier.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node">node</a>&nbsp;(...)</td>
<td class="summary">
Fetch or create a new dispatching node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node_childs">node_childs</a>&nbsp;(node)</td>
<td class="summary">
Return a sorted table of visible childs within a given node
</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node_visible">node_visible</a>&nbsp;(node)</td>
<td class="summary">
Check whether a dispatch node shall be visible
</td>
</tr>
<tr>
<td class="name" nowrap><a href="#rewrite">rewrite</a>&nbsp;(n, ...)</td>
<td class="summary">
Rewrite the first x path values of the request.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#template">template</a>&nbsp;(name)</td>
<td class="summary">
Create a template render dispatching target.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#translate">translate</a>&nbsp;(text)</td>
<td class="summary">
Access the luci.i18n translate() api.</td>
</tr>
</table>
<br/>
<br/>
<h2><a name="functions"></a>Functions</h2>
<dl class="function">
<dt><a name="_"></a><strong>_</strong>&nbsp;()</dt>
<dd>
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.
</dd>
<dt><a name="alias"></a><strong>alias</strong>&nbsp;(...)</dt>
<dd>
Create a redirect to another dispatching node.
<h3>Parameters</h3>
<ul>
<li>
...: Virtual path destination
</li>
</ul>
</dd>
<dt><a name="arcombine"></a><strong>arcombine</strong>&nbsp;(trg1, trg2)</dt>
<dd>
Create a combined dispatching target for non argv and argv requests.
<h3>Parameters</h3>
<ul>
<li>
trg1: Overview Target
</li>
<li>
trg2: Detail Target
</li>
</ul>
</dd>
<dt><a name="assign"></a><strong>assign</strong>&nbsp;(path, clone, title, order)</dt>
<dd>
Clone a node of the dispatching tree to another position.
<h3>Parameters</h3>
<ul>
<li>
path: Virtual path destination
</li>
<li>
clone: Virtual path source
</li>
<li>
title: Destination node title (optional)
</li>
<li>
order: Destination node order value (optional)
</li>
</ul>
<h3>Return value:</h3>
Dispatching tree node
</dd>
<dt><a name="build_url"></a><strong>build_url</strong>&nbsp;(...)</dt>
<dd>
Build the URL relative to the server webroot from given virtual path.
<h3>Parameters</h3>
<ul>
<li>
...: Virtual path
</li>
</ul>
<h3>Return value:</h3>
Relative URL
</dd>
<dt><a name="call"></a><strong>call</strong>&nbsp;(name, ...)</dt>
<dd>
Create a function-call dispatching target.
<h3>Parameters</h3>
<ul>
<li>
name: Target function of local controller
</li>
<li>
...: Additional parameters passed to the function
</li>
</ul>
</dd>
<dt><a name="cbi"></a><strong>cbi</strong>&nbsp;(model)</dt>
<dd>
Create a CBI model dispatching target.
<h3>Parameters</h3>
<ul>
<li>
model: CBI model to be rendered
</li>
</ul>
</dd>
<dt><a name="createindex"></a><strong>createindex</strong>&nbsp;()</dt>
<dd>
Generate the dispatching index using the native file-cache based strategy.
</dd>
<dt><a name="createtree"></a><strong>createtree</strong>&nbsp;()</dt>
<dd>
Create the dispatching tree from the index.
Build the index before if it does not exist yet.
</dd>
<dt><a name="dispatch"></a><strong>dispatch</strong>&nbsp;(request)</dt>
<dd>
Dispatches a LuCI virtual path.
<h3>Parameters</h3>
<ul>
<li>
request: Virtual path
</li>
</ul>
</dd>
<dt><a name="entry"></a><strong>entry</strong>&nbsp;(path, target, title, order)</dt>
<dd>
Create a new dispatching node and define common parameters.
<h3>Parameters</h3>
<ul>
<li>
path: Virtual path
</li>
<li>
target: Target function to call when dispatched.
</li>
<li>
title: Destination node title
</li>
<li>
order: Destination node order value (optional)
</li>
</ul>
<h3>Return value:</h3>
Dispatching tree node
</dd>
<dt><a name="error404"></a><strong>error404</strong>&nbsp;(message)</dt>
<dd>
Send a 404 error code and render the "error404" template if available.
<h3>Parameters</h3>
<ul>
<li>
message: Custom error message (optional)
</li>
</ul>
<h3>Return value:</h3>
false
</dd>
<dt><a name="error500"></a><strong>error500</strong>&nbsp;(message)</dt>
<dd>
Send a 500 error code and render the "error500" template if available.
<h3>Parameters</h3>
<ul>
<li>
message: Custom error message (optional)#
</li>
</ul>
<h3>Return value:</h3>
false
</dd>
<dt><a name="firstchild"></a><strong>firstchild</strong>&nbsp;()</dt>
<dd>
Alias the first (lowest order) page automatically
</dd>
<dt><a name="form"></a><strong>form</strong>&nbsp;(model)</dt>
<dd>
Create a CBI form model dispatching target.
<h3>Parameters</h3>
<ul>
<li>
model: CBI form model tpo be rendered
</li>
</ul>
</dd>
<dt><a name="get"></a><strong>get</strong>&nbsp;(...)</dt>
<dd>
Fetch or create a dispatching node without setting the target module or
enabling the node.
<h3>Parameters</h3>
<ul>
<li>
...: Virtual path
</li>
</ul>
<h3>Return value:</h3>
Dispatching tree node
</dd>
<dt><a name="httpdispatch"></a><strong>httpdispatch</strong>&nbsp;(request)</dt>
<dd>
Dispatch an HTTP request.
<h3>Parameters</h3>
<ul>
<li>
request: LuCI HTTP Request object
</li>
</ul>
</dd>
<dt><a name="modifier"></a><strong>modifier</strong>&nbsp;(func, order)</dt>
<dd>
Register a tree modifier.
<h3>Parameters</h3>
<ul>
<li>
func: Modifier function
</li>
<li>
order: Modifier order value (optional)
</li>
</ul>
</dd>
<dt><a name="node"></a><strong>node</strong>&nbsp;(...)</dt>
<dd>
Fetch or create a new dispatching node.
<h3>Parameters</h3>
<ul>
<li>
...: Virtual path
</li>
</ul>
<h3>Return value:</h3>
Dispatching tree node
</dd>
<dt><a name="node_childs"></a><strong>node_childs</strong>&nbsp;(node)</dt>
<dd>
Return a sorted table of visible childs within a given node
<h3>Parameters</h3>
<ul>
<li>
node: Dispatch node
</li>
</ul>
<h3>Return value:</h3>
Ordered table of child node names
</dd>
<dt><a name="node_visible"></a><strong>node_visible</strong>&nbsp;(node)</dt>
<dd>
Check whether a dispatch node shall be visible
<h3>Parameters</h3>
<ul>
<li>
node: Dispatch node
</li>
</ul>
<h3>Return value:</h3>
Boolean indicating whether the node should be visible
</dd>
<dt><a name="rewrite"></a><strong>rewrite</strong>&nbsp;(n, ...)</dt>
<dd>
Rewrite the first x path values of the request.
<h3>Parameters</h3>
<ul>
<li>
n: Number of path values to replace
</li>
<li>
...: Virtual path to replace removed path values with
</li>
</ul>
</dd>
<dt><a name="template"></a><strong>template</strong>&nbsp;(name)</dt>
<dd>
Create a template render dispatching target.
<h3>Parameters</h3>
<ul>
<li>
name: Template to be rendered
</li>
</ul>
</dd>
<dt><a name="translate"></a><strong>translate</strong>&nbsp;(text)</dt>
<dd>
Access the luci.i18n translate() api.
<h3>Parameters</h3>
<ul>
<li>
text: Text to translate
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>