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.protocol.html">luci.http.protocol</a>
44 <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
48 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
52 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.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.jsonc.html">luci.jsonc</a>
72 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
76 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
80 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
84 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
88 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
92 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
96 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
100 <a href="../modules/nixio.html">nixio</a>
104 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
108 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
112 <a href="../modules/nixio.File.html">nixio.File</a>
116 <a href="../modules/nixio.README.html">nixio.README</a>
120 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
124 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
128 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
132 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
136 <a href="../modules/nixio.bin.html">nixio.bin</a>
140 <a href="../modules/nixio.bit.html">nixio.bit</a>
144 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
148 <a href="../modules/nixio.fs.html">nixio.fs</a>
163 </div><!-- id="navigation" -->
167 <h1>Class <code>luci.dispatcher</code></h1>
178 <table class="function_list">
181 <td class="name" nowrap><a href="#_">_</a> ()</td>
184 No-op function used to mark translation entries for menu labels.</td>
188 <td class="name" nowrap><a href="#alias">alias</a> (...)</td>
191 Create a redirect to another dispatching node.</td>
195 <td class="name" nowrap><a href="#arcombine">arcombine</a> (trg1, trg2)</td>
198 Create a combined dispatching target for non argv and argv requests.</td>
202 <td class="name" nowrap><a href="#assign">assign</a> (path, clone, title, order)</td>
205 Clone a node of the dispatching tree to another position.</td>
209 <td class="name" nowrap><a href="#build_url">build_url</a> (...)</td>
212 Build the URL relative to the server webroot from given virtual path.</td>
216 <td class="name" nowrap><a href="#call">call</a> (name, ...)</td>
219 Create a function-call dispatching target.</td>
223 <td class="name" nowrap><a href="#cbi">cbi</a> (model)</td>
226 Create a CBI model dispatching target.</td>
230 <td class="name" nowrap><a href="#createindex">createindex</a> ()</td>
233 Generate the dispatching index using the native file-cache based strategy.</td>
237 <td class="name" nowrap><a href="#createtree">createtree</a> ()</td>
240 Create the dispatching tree from the index.</td>
244 <td class="name" nowrap><a href="#dispatch">dispatch</a> (request)</td>
247 Dispatches a LuCI virtual path.</td>
251 <td class="name" nowrap><a href="#entry">entry</a> (path, target, title, order)</td>
254 Create a new dispatching node and define common parameters.</td>
258 <td class="name" nowrap><a href="#error404">error404</a> (message)</td>
261 Send a 404 error code and render the "error404" template if available.</td>
265 <td class="name" nowrap><a href="#error500">error500</a> (message)</td>
268 Send a 500 error code and render the "error500" template if available.</td>
272 <td class="name" nowrap><a href="#firstchild">firstchild</a> ()</td>
275 Alias the first (lowest order) page automatically
281 <td class="name" nowrap><a href="#form">form</a> (model)</td>
284 Create a CBI form model dispatching target.</td>
288 <td class="name" nowrap><a href="#get">get</a> (...)</td>
291 Fetch or create a dispatching node without setting the target module or
293 enabling the node.</td>
297 <td class="name" nowrap><a href="#httpdispatch">httpdispatch</a> (request)</td>
300 Dispatch an HTTP request.</td>
304 <td class="name" nowrap><a href="#modifier">modifier</a> (func, order)</td>
307 Register a tree modifier.</td>
311 <td class="name" nowrap><a href="#node">node</a> (...)</td>
314 Fetch or create a new dispatching node.</td>
318 <td class="name" nowrap><a href="#node_childs">node_childs</a> (node)</td>
321 Return a sorted table of visible childs within a given node
326 <td class="name" nowrap><a href="#node_visible">node_visible</a> (node)</td>
329 Check whether a dispatch node shall be visible
334 <td class="name" nowrap><a href="#rewrite">rewrite</a> (n, ...)</td>
337 Rewrite the first x path values of the request.</td>
341 <td class="name" nowrap><a href="#template">template</a> (name)</td>
344 Create a template render dispatching target.</td>
348 <td class="name" nowrap><a href="#translate">translate</a> (text)</td>
351 Access the luci.i18n translate() api.</td>
365 <h2><a name="functions"></a>Functions</h2>
366 <dl class="function">
370 <dt><a name="_"></a><strong>_</strong> ()</dt>
374 No-op function used to mark translation entries for menu labels.
376 This function does not actually translate the given argument but
377 is used by build/i18n-scan.pl to find translatable entries.
393 <dt><a name="alias"></a><strong>alias</strong> (...)</dt>
397 Create a redirect to another dispatching node.
405 ...: Virtual path destination
422 <dt><a name="arcombine"></a><strong>arcombine</strong> (trg1, trg2)</dt>
426 Create a combined dispatching target for non argv and argv requests.
434 trg1: Overview Target
455 <dt><a name="assign"></a><strong>assign</strong> (path, clone, title, order)</dt>
459 Clone a node of the dispatching tree to another position.
467 path: Virtual path destination
471 clone: Virtual path source
475 title: Destination node title (optional)
479 order: Destination node order value (optional)
489 <h3>Return value:</h3>
490 Dispatching tree node
499 <dt><a name="build_url"></a><strong>build_url</strong> (...)</dt>
503 Build the URL relative to the server webroot from given virtual path.
521 <h3>Return value:</h3>
531 <dt><a name="call"></a><strong>call</strong> (name, ...)</dt>
535 Create a function-call dispatching target.
543 name: Target function of local controller
547 ...: Additional parameters passed to the function
564 <dt><a name="cbi"></a><strong>cbi</strong> (model)</dt>
568 Create a CBI model dispatching target.
576 model: CBI model to be rendered
593 <dt><a name="createindex"></a><strong>createindex</strong> ()</dt>
597 Generate the dispatching index using the native file-cache based strategy.
614 <dt><a name="createtree"></a><strong>createtree</strong> ()</dt>
618 Create the dispatching tree from the index.
620 Build the index before if it does not exist yet.
636 <dt><a name="dispatch"></a><strong>dispatch</strong> (request)</dt>
640 Dispatches a LuCI virtual path.
648 request: Virtual path
665 <dt><a name="entry"></a><strong>entry</strong> (path, target, title, order)</dt>
669 Create a new dispatching node and define common parameters.
681 target: Target function to call when dispatched.
685 title: Destination node title
689 order: Destination node order value (optional)
699 <h3>Return value:</h3>
700 Dispatching tree node
709 <dt><a name="error404"></a><strong>error404</strong> (message)</dt>
713 Send a 404 error code and render the "error404" template if available.
721 message: Custom error message (optional)
731 <h3>Return value:</h3>
741 <dt><a name="error500"></a><strong>error500</strong> (message)</dt>
745 Send a 500 error code and render the "error500" template if available.
753 message: Custom error message (optional)#
763 <h3>Return value:</h3>
773 <dt><a name="firstchild"></a><strong>firstchild</strong> ()</dt>
777 Alias the first (lowest order) page automatically
794 <dt><a name="form"></a><strong>form</strong> (model)</dt>
798 Create a CBI form model dispatching target.
806 model: CBI form model tpo be rendered
823 <dt><a name="get"></a><strong>get</strong> (...)</dt>
827 Fetch or create a dispatching node without setting the target module or
846 <h3>Return value:</h3>
847 Dispatching tree node
856 <dt><a name="httpdispatch"></a><strong>httpdispatch</strong> (request)</dt>
860 Dispatch an HTTP request.
868 request: LuCI HTTP Request object
885 <dt><a name="modifier"></a><strong>modifier</strong> (func, order)</dt>
889 Register a tree modifier.
897 func: Modifier function
901 order: Modifier order value (optional)
918 <dt><a name="node"></a><strong>node</strong> (...)</dt>
922 Fetch or create a new dispatching node.
940 <h3>Return value:</h3>
941 Dispatching tree node
950 <dt><a name="node_childs"></a><strong>node_childs</strong> (node)</dt>
954 Return a sorted table of visible childs within a given node
972 <h3>Return value:</h3>
973 Ordered table of child node names
982 <dt><a name="node_visible"></a><strong>node_visible</strong> (node)</dt>
986 Check whether a dispatch node shall be visible
1004 <h3>Return value:</h3>
1005 Boolean indicating whether the node should be visible
1014 <dt><a name="rewrite"></a><strong>rewrite</strong> (n, ...)</dt>
1018 Rewrite the first x path values of the request.
1026 n: Number of path values to replace
1030 ...: Virtual path to replace removed path values with
1047 <dt><a name="template"></a><strong>template</strong> (name)</dt>
1051 Create a template render dispatching target.
1059 name: Template to be rendered
1076 <dt><a name="translate"></a><strong>translate</strong> (text)</dt>
1080 Access the luci.i18n translate() api.
1088 text: Text to translate
1109 </div> <!-- id="content" -->
1111 </div> <!-- id="main" -->
1114 <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>
1115 </div> <!-- id="about" -->
1117 </div> <!-- id="container" -->