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.protocol.html">luci.http.protocol</a>
48 <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
52 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
56 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
60 <a href="../modules/luci.i18n.html">luci.i18n</a>
64 <a href="../modules/luci.ip.html">luci.ip</a>
68 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
72 <a href="../modules/luci.json.html">luci.json</a>
76 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
80 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
84 <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
88 <a href="../modules/luci.model.uci.html">luci.model.uci</a>
92 <a href="../modules/luci.rpcc.html">luci.rpcc</a>
96 <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
100 <a href="../modules/luci.sys.html">luci.sys</a>
104 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
108 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
112 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
116 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
120 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
124 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
128 <a href="../modules/luci.util.html">luci.util</a>
132 <a href="../modules/nixio.html">nixio</a>
136 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
140 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
144 <a href="../modules/nixio.File.html">nixio.File</a>
148 <a href="../modules/nixio.README.html">nixio.README</a>
152 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
156 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
160 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
164 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
168 <a href="../modules/nixio.bin.html">nixio.bin</a>
172 <a href="../modules/nixio.bit.html">nixio.bit</a>
176 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
180 <a href="../modules/nixio.fs.html">nixio.fs</a>
195 </div><!-- id="navigation" -->
199 <h1>Class <code>luci.dispatcher</code></h1>
210 <table class="function_list">
213 <td class="name" nowrap><a href="#_">_</a> ()</td>
216 No-op function used to mark translation entries for menu labels.</td>
220 <td class="name" nowrap><a href="#alias">alias</a> (...)</td>
223 Create a redirect to another dispatching node.</td>
227 <td class="name" nowrap><a href="#arcombine">arcombine</a> (trg1, trg2)</td>
230 Create a combined dispatching target for non argv and argv requests.</td>
234 <td class="name" nowrap><a href="#assign">assign</a> (path, clone, title, order)</td>
237 Clone a node of the dispatching tree to another position.</td>
241 <td class="name" nowrap><a href="#build_url">build_url</a> (...)</td>
244 Build the URL relative to the server webroot from given virtual path.</td>
248 <td class="name" nowrap><a href="#call">call</a> (name, ...)</td>
251 Create a function-call dispatching target.</td>
255 <td class="name" nowrap><a href="#cbi">cbi</a> (model)</td>
258 Create a CBI model dispatching target.</td>
262 <td class="name" nowrap><a href="#createindex">createindex</a> ()</td>
265 Generate the dispatching index using the native file-cache based strategy.</td>
269 <td class="name" nowrap><a href="#createtree">createtree</a> ()</td>
272 Create the dispatching tree from the index.</td>
276 <td class="name" nowrap><a href="#dispatch">dispatch</a> (request)</td>
279 Dispatches a LuCI virtual path.</td>
283 <td class="name" nowrap><a href="#entry">entry</a> (path, target, title, order)</td>
286 Create a new dispatching node and define common parameters.</td>
290 <td class="name" nowrap><a href="#error404">error404</a> (message)</td>
293 Send a 404 error code and render the "error404" template if available.</td>
297 <td class="name" nowrap><a href="#error500">error500</a> (message)</td>
300 Send a 500 error code and render the "error500" template if available.</td>
304 <td class="name" nowrap><a href="#firstchild">firstchild</a> ()</td>
307 Alias the first (lowest order) page automatically
313 <td class="name" nowrap><a href="#form">form</a> (model)</td>
316 Create a CBI form model dispatching target.</td>
320 <td class="name" nowrap><a href="#get">get</a> (...)</td>
323 Fetch or create a dispatching node without setting the target module or
325 enabling the node.</td>
329 <td class="name" nowrap><a href="#httpdispatch">httpdispatch</a> (request)</td>
332 Dispatch an HTTP request.</td>
336 <td class="name" nowrap><a href="#modifier">modifier</a> (func, order)</td>
339 Register a tree modifier.</td>
343 <td class="name" nowrap><a href="#node">node</a> (...)</td>
346 Fetch or create a new dispatching node.</td>
350 <td class="name" nowrap><a href="#node_childs">node_childs</a> (node)</td>
353 Return a sorted table of visible childs within a given node
358 <td class="name" nowrap><a href="#node_visible">node_visible</a> (node)</td>
361 Check whether a dispatch node shall be visible
366 <td class="name" nowrap><a href="#rewrite">rewrite</a> (n, ...)</td>
369 Rewrite the first x path values of the request.</td>
373 <td class="name" nowrap><a href="#template">template</a> (name)</td>
376 Create a template render dispatching target.</td>
380 <td class="name" nowrap><a href="#translate">translate</a> (text)</td>
383 Access the luci.i18n translate() api.</td>
397 <h2><a name="functions"></a>Functions</h2>
398 <dl class="function">
402 <dt><a name="_"></a><strong>_</strong> ()</dt>
406 No-op function used to mark translation entries for menu labels.
408 This function does not actually translate the given argument but
409 is used by build/i18n-scan.pl to find translatable entries.
425 <dt><a name="alias"></a><strong>alias</strong> (...)</dt>
429 Create a redirect to another dispatching node.
437 ...: Virtual path destination
454 <dt><a name="arcombine"></a><strong>arcombine</strong> (trg1, trg2)</dt>
458 Create a combined dispatching target for non argv and argv requests.
466 trg1: Overview Target
487 <dt><a name="assign"></a><strong>assign</strong> (path, clone, title, order)</dt>
491 Clone a node of the dispatching tree to another position.
499 path: Virtual path destination
503 clone: Virtual path source
507 title: Destination node title (optional)
511 order: Destination node order value (optional)
521 <h3>Return value:</h3>
522 Dispatching tree node
531 <dt><a name="build_url"></a><strong>build_url</strong> (...)</dt>
535 Build the URL relative to the server webroot from given virtual path.
553 <h3>Return value:</h3>
563 <dt><a name="call"></a><strong>call</strong> (name, ...)</dt>
567 Create a function-call dispatching target.
575 name: Target function of local controller
579 ...: Additional parameters passed to the function
596 <dt><a name="cbi"></a><strong>cbi</strong> (model)</dt>
600 Create a CBI model dispatching target.
608 model: CBI model to be rendered
625 <dt><a name="createindex"></a><strong>createindex</strong> ()</dt>
629 Generate the dispatching index using the native file-cache based strategy.
646 <dt><a name="createtree"></a><strong>createtree</strong> ()</dt>
650 Create the dispatching tree from the index.
652 Build the index before if it does not exist yet.
668 <dt><a name="dispatch"></a><strong>dispatch</strong> (request)</dt>
672 Dispatches a LuCI virtual path.
680 request: Virtual path
697 <dt><a name="entry"></a><strong>entry</strong> (path, target, title, order)</dt>
701 Create a new dispatching node and define common parameters.
713 target: Target function to call when dispatched.
717 title: Destination node title
721 order: Destination node order value (optional)
731 <h3>Return value:</h3>
732 Dispatching tree node
741 <dt><a name="error404"></a><strong>error404</strong> (message)</dt>
745 Send a 404 error code and render the "error404" template if available.
753 message: Custom error message (optional)
763 <h3>Return value:</h3>
773 <dt><a name="error500"></a><strong>error500</strong> (message)</dt>
777 Send a 500 error code and render the "error500" template if available.
785 message: Custom error message (optional)#
795 <h3>Return value:</h3>
805 <dt><a name="firstchild"></a><strong>firstchild</strong> ()</dt>
809 Alias the first (lowest order) page automatically
826 <dt><a name="form"></a><strong>form</strong> (model)</dt>
830 Create a CBI form model dispatching target.
838 model: CBI form model tpo be rendered
855 <dt><a name="get"></a><strong>get</strong> (...)</dt>
859 Fetch or create a dispatching node without setting the target module or
878 <h3>Return value:</h3>
879 Dispatching tree node
888 <dt><a name="httpdispatch"></a><strong>httpdispatch</strong> (request)</dt>
892 Dispatch an HTTP request.
900 request: LuCI HTTP Request object
917 <dt><a name="modifier"></a><strong>modifier</strong> (func, order)</dt>
921 Register a tree modifier.
929 func: Modifier function
933 order: Modifier order value (optional)
950 <dt><a name="node"></a><strong>node</strong> (...)</dt>
954 Fetch or create a new dispatching node.
972 <h3>Return value:</h3>
973 Dispatching tree node
982 <dt><a name="node_childs"></a><strong>node_childs</strong> (node)</dt>
986 Return a sorted table of visible childs within a given node
1004 <h3>Return value:</h3>
1005 Ordered table of child node names
1014 <dt><a name="node_visible"></a><strong>node_visible</strong> (node)</dt>
1018 Check whether a dispatch node shall be visible
1036 <h3>Return value:</h3>
1037 Boolean indicating whether the node should be visible
1046 <dt><a name="rewrite"></a><strong>rewrite</strong> (n, ...)</dt>
1050 Rewrite the first x path values of the request.
1058 n: Number of path values to replace
1062 ...: Virtual path to replace removed path values with
1079 <dt><a name="template"></a><strong>template</strong> (name)</dt>
1083 Create a template render dispatching target.
1091 name: Template to be rendered
1108 <dt><a name="translate"></a><strong>translate</strong> (text)</dt>
1112 Access the luci.i18n translate() api.
1120 text: Text to translate
1141 </div> <!-- id="content" -->
1143 </div> <!-- id="main" -->
1146 <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>
1147 </div> <!-- id="about" -->
1149 </div> <!-- id="container" -->