1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <title>Reference</title>
6 <link rel="stylesheet" href="../luadoc.css" type="text/css" />
7 <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
14 <div id="product_logo"></div>
15 <div id="product_name"><big><b></b></big></div>
16 <div id="product_description"></div>
17 </div> <!-- id="product" -->
27 <li><a href="../index.html">Index</a></li>
37 <li><strong>luci.dispatcher</strong></li>
40 <a href="../modules/luci.http.html">luci.http</a>
44 <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
48 <a href="../modules/luci.http.date.html">luci.http.date</a>
52 <a href="../modules/luci.http.mime.html">luci.http.mime</a>
56 <a href="../modules/luci.i18n.html">luci.i18n</a>
60 <a href="../modules/luci.ip.html">luci.ip</a>
64 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
68 <a href="../modules/luci.json.html">luci.json</a>
72 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
76 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
80 <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
84 <a href="../modules/luci.model.uci.html">luci.model.uci</a>
88 <a href="../modules/luci.rpcc.html">luci.rpcc</a>
92 <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
96 <a href="../modules/luci.sys.html">luci.sys</a>
100 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
104 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
108 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
112 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
116 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
120 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
124 <a href="../modules/luci.util.html">luci.util</a>
128 <a href="../modules/nixio.html">nixio</a>
132 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
136 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
140 <a href="../modules/nixio.File.html">nixio.File</a>
144 <a href="../modules/nixio.README.html">nixio.README</a>
148 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
152 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
156 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
160 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
164 <a href="../modules/nixio.bin.html">nixio.bin</a>
168 <a href="../modules/nixio.bit.html">nixio.bit</a>
172 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
176 <a href="../modules/nixio.fs.html">nixio.fs</a>
191 </div><!-- id="navigation" -->
195 <h1>Class <code>luci.dispatcher</code></h1>
206 <table class="function_list">
209 <td class="name" nowrap><a href="#_">_</a> ()</td>
212 No-op function used to mark translation entries for menu labels.</td>
216 <td class="name" nowrap><a href="#alias">alias</a> (...)</td>
219 Create a redirect to another dispatching node.</td>
223 <td class="name" nowrap><a href="#arcombine">arcombine</a> (trg1, trg2)</td>
226 Create a combined dispatching target for non argv and argv requests.</td>
230 <td class="name" nowrap><a href="#assign">assign</a> (path, clone, title, order)</td>
233 Clone a node of the dispatching tree to another position.</td>
237 <td class="name" nowrap><a href="#build_url">build_url</a> (...)</td>
240 Build the URL relative to the server webroot from given virtual path.</td>
244 <td class="name" nowrap><a href="#call">call</a> (name, ...)</td>
247 Create a function-call dispatching target.</td>
251 <td class="name" nowrap><a href="#cbi">cbi</a> (model)</td>
254 Create a CBI model dispatching target.</td>
258 <td class="name" nowrap><a href="#createindex">createindex</a> ()</td>
261 Generate the dispatching index using the native file-cache based strategy.</td>
265 <td class="name" nowrap><a href="#createtree">createtree</a> ()</td>
268 Create the dispatching tree from the index.</td>
272 <td class="name" nowrap><a href="#dispatch">dispatch</a> (request)</td>
275 Dispatches a LuCI virtual path.</td>
279 <td class="name" nowrap><a href="#entry">entry</a> (path, target, title, order)</td>
282 Create a new dispatching node and define common parameters.</td>
286 <td class="name" nowrap><a href="#error404">error404</a> (message)</td>
289 Send a 404 error code and render the "error404" template if available.</td>
293 <td class="name" nowrap><a href="#error500">error500</a> (message)</td>
296 Send a 500 error code and render the "error500" template if available.</td>
300 <td class="name" nowrap><a href="#firstchild">firstchild</a> ()</td>
303 Alias the first (lowest order) page automatically
309 <td class="name" nowrap><a href="#form">form</a> (model)</td>
312 Create a CBI form model dispatching target.</td>
316 <td class="name" nowrap><a href="#get">get</a> (...)</td>
319 Fetch or create a dispatching node without setting the target module or
320 enabling the node.</td>
324 <td class="name" nowrap><a href="#httpdispatch">httpdispatch</a> (request)</td>
327 Dispatch an HTTP request.</td>
331 <td class="name" nowrap><a href="#lookup">lookup</a> (...)</td>
334 Lookup node in dispatching tree.</td>
338 <td class="name" nowrap><a href="#modifier">modifier</a> (func, order)</td>
341 Register a tree modifier.</td>
345 <td class="name" nowrap><a href="#node">node</a> (...)</td>
348 Fetch or create a new dispatching node.</td>
352 <td class="name" nowrap><a href="#node_childs">node_childs</a> (node)</td>
355 Return a sorted table of visible childs within a given node
360 <td class="name" nowrap><a href="#node_visible">node_visible</a> (node)</td>
363 Check whether a dispatch node shall be visible
368 <td class="name" nowrap><a href="#rewrite">rewrite</a> (n, ...)</td>
371 Rewrite the first x path values of the request.</td>
375 <td class="name" nowrap><a href="#template">template</a> (name)</td>
378 Create a template render dispatching target.</td>
382 <td class="name" nowrap><a href="#translate">translate</a> (text)</td>
385 Access the luci.i18n translate() api.</td>
399 <h2><a name="functions"></a>Functions</h2>
400 <dl class="function">
404 <dt><a name="_"></a><strong>_</strong> ()</dt>
408 No-op function used to mark translation entries for menu labels.
410 This function does not actually translate the given argument but
411 is used by build/i18n-scan.pl to find translatable entries.
427 <dt><a name="alias"></a><strong>alias</strong> (...)</dt>
431 Create a redirect to another dispatching node.
439 ...: Virtual path destination
456 <dt><a name="arcombine"></a><strong>arcombine</strong> (trg1, trg2)</dt>
460 Create a combined dispatching target for non argv and argv requests.
468 trg1: Overview Target
489 <dt><a name="assign"></a><strong>assign</strong> (path, clone, title, order)</dt>
493 Clone a node of the dispatching tree to another position.
501 path: Virtual path destination
505 clone: Virtual path source
509 title: Destination node title (optional)
513 order: Destination node order value (optional)
523 <h3>Return value:</h3>
524 Dispatching tree node
533 <dt><a name="build_url"></a><strong>build_url</strong> (...)</dt>
537 Build the URL relative to the server webroot from given virtual path.
555 <h3>Return value:</h3>
565 <dt><a name="call"></a><strong>call</strong> (name, ...)</dt>
569 Create a function-call dispatching target.
577 name: Target function of local controller
581 ...: Additional parameters passed to the function
598 <dt><a name="cbi"></a><strong>cbi</strong> (model)</dt>
602 Create a CBI model dispatching target.
610 model: CBI model to be rendered
627 <dt><a name="createindex"></a><strong>createindex</strong> ()</dt>
631 Generate the dispatching index using the native file-cache based strategy.
648 <dt><a name="createtree"></a><strong>createtree</strong> ()</dt>
652 Create the dispatching tree from the index.
654 Build the index before if it does not exist yet.
670 <dt><a name="dispatch"></a><strong>dispatch</strong> (request)</dt>
674 Dispatches a LuCI virtual path.
682 request: Virtual path
699 <dt><a name="entry"></a><strong>entry</strong> (path, target, title, order)</dt>
703 Create a new dispatching node and define common parameters.
715 target: Target function to call when dispatched.
719 title: Destination node title
723 order: Destination node order value (optional)
733 <h3>Return value:</h3>
734 Dispatching tree node
743 <dt><a name="error404"></a><strong>error404</strong> (message)</dt>
747 Send a 404 error code and render the "error404" template if available.
755 message: Custom error message (optional)
765 <h3>Return value:</h3>
775 <dt><a name="error500"></a><strong>error500</strong> (message)</dt>
779 Send a 500 error code and render the "error500" template if available.
787 message: Custom error message (optional)#
797 <h3>Return value:</h3>
807 <dt><a name="firstchild"></a><strong>firstchild</strong> ()</dt>
811 Alias the first (lowest order) page automatically
828 <dt><a name="form"></a><strong>form</strong> (model)</dt>
832 Create a CBI form model dispatching target.
840 model: CBI form model tpo be rendered
857 <dt><a name="get"></a><strong>get</strong> (...)</dt>
861 Fetch or create a dispatching node without setting the target module or
880 <h3>Return value:</h3>
881 Dispatching tree node
890 <dt><a name="httpdispatch"></a><strong>httpdispatch</strong> (request)</dt>
894 Dispatch an HTTP request.
902 request: LuCI HTTP Request object
919 <dt><a name="lookup"></a><strong>lookup</strong> (...)</dt>
923 Lookup node in dispatching tree.
941 <h3>Return value:</h3>
942 Node object, canonical url or nil if the path was not found.
951 <dt><a name="modifier"></a><strong>modifier</strong> (func, order)</dt>
955 Register a tree modifier.
963 func: Modifier function
967 order: Modifier order value (optional)
984 <dt><a name="node"></a><strong>node</strong> (...)</dt>
988 Fetch or create a new dispatching node.
1006 <h3>Return value:</h3>
1007 Dispatching tree node
1016 <dt><a name="node_childs"></a><strong>node_childs</strong> (node)</dt>
1020 Return a sorted table of visible childs within a given node
1038 <h3>Return value:</h3>
1039 Ordered table of child node names
1048 <dt><a name="node_visible"></a><strong>node_visible</strong> (node)</dt>
1052 Check whether a dispatch node shall be visible
1070 <h3>Return value:</h3>
1071 Boolean indicating whether the node should be visible
1080 <dt><a name="rewrite"></a><strong>rewrite</strong> (n, ...)</dt>
1084 Rewrite the first x path values of the request.
1092 n: Number of path values to replace
1096 ...: Virtual path to replace removed path values with
1113 <dt><a name="template"></a><strong>template</strong> (name)</dt>
1117 Create a template render dispatching target.
1125 name: Template to be rendered
1142 <dt><a name="translate"></a><strong>translate</strong> (text)</dt>
1146 Access the luci.i18n translate() api.
1154 text: Text to translate
1175 </div> <!-- id="content" -->
1177 </div> <!-- id="main" -->
1180 <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>
1181 </div> <!-- id="about" -->
1183 </div> <!-- id="container" -->