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/luci.xml.html">luci.xml
</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
324 enabling the node.
</td>
328 <td class=
"name" nowrap
><a href=
"#httpdispatch">httpdispatch
</a> (request)
</td>
331 Dispatch an HTTP request.
</td>
335 <td class=
"name" nowrap
><a href=
"#lookup">lookup
</a> (...)
</td>
338 Lookup node in dispatching tree.
</td>
342 <td class=
"name" nowrap
><a href=
"#node">node
</a> (...)
</td>
345 Fetch or create a new dispatching node.
</td>
349 <td class=
"name" nowrap
><a href=
"#node_childs">node_childs
</a> (node)
</td>
352 Return a sorted table of visible children within a given node
357 <td class=
"name" nowrap
><a href=
"#node_visible">node_visible
</a> (node)
</td>
360 Check whether a dispatch node shall be visible
365 <td class=
"name" nowrap
><a href=
"#rewrite">rewrite
</a> (n, ...)
</td>
368 Rewrite the first x path values of the request.
</td>
372 <td class=
"name" nowrap
><a href=
"#template">template
</a> (name)
</td>
375 Create a template render dispatching target.
</td>
379 <td class=
"name" nowrap
><a href=
"#translate">translate
</a> (text)
</td>
382 Access the luci.i18n translate() api.
</td>
396 <h2><a name=
"functions"></a>Functions
</h2>
397 <dl class=
"function">
401 <dt><a name=
"_"></a><strong>_
</strong> ()
</dt>
405 No-op function used to mark translation entries for menu labels.
407 This function does not actually translate the given argument but
408 is used by build/i18n-scan.pl to find translatable entries.
424 <dt><a name=
"alias"></a><strong>alias
</strong> (...)
</dt>
428 Create a redirect to another dispatching node.
436 ...: Virtual path destination
453 <dt><a name=
"arcombine"></a><strong>arcombine
</strong> (trg1, trg2)
</dt>
457 Create a combined dispatching target for non argv and argv requests.
465 trg1: Overview Target
486 <dt><a name=
"assign"></a><strong>assign
</strong> (path, clone, title, order)
</dt>
490 Clone a node of the dispatching tree to another position.
498 path: Virtual path destination
502 clone: Virtual path source
506 title: Destination node title (optional)
510 order: Destination node order value (optional)
520 <h3>Return value:
</h3>
521 Dispatching tree node
530 <dt><a name=
"build_url"></a><strong>build_url
</strong> (...)
</dt>
534 Build the URL relative to the server webroot from given virtual path.
552 <h3>Return value:
</h3>
562 <dt><a name=
"call"></a><strong>call
</strong> (name, ...)
</dt>
566 Create a function-call dispatching target.
574 name: Target function of local controller
578 ...: Additional parameters passed to the function
595 <dt><a name=
"cbi"></a><strong>cbi
</strong> (model)
</dt>
599 Create a CBI model dispatching target.
607 model: CBI model to be rendered
624 <dt><a name=
"createindex"></a><strong>createindex
</strong> ()
</dt>
628 Generate the dispatching index using the native file-cache based strategy.
645 <dt><a name=
"createtree"></a><strong>createtree
</strong> ()
</dt>
649 Create the dispatching tree from the index.
651 Build the index before if it does not exist yet.
667 <dt><a name=
"dispatch"></a><strong>dispatch
</strong> (request)
</dt>
671 Dispatches a LuCI virtual path.
679 request: Virtual path
696 <dt><a name=
"entry"></a><strong>entry
</strong> (path, target, title, order)
</dt>
700 Create a new dispatching node and define common parameters.
712 target: Target function to call when dispatched.
716 title: Destination node title
720 order: Destination node order value (optional)
730 <h3>Return value:
</h3>
731 Dispatching tree node
740 <dt><a name=
"error404"></a><strong>error404
</strong> (message)
</dt>
744 Send a
404 error code and render the
"error404" template if available.
752 message: Custom error message (optional)
762 <h3>Return value:
</h3>
772 <dt><a name=
"error500"></a><strong>error500
</strong> (message)
</dt>
776 Send a
500 error code and render the
"error500" template if available.
784 message: Custom error message (optional)#
794 <h3>Return value:
</h3>
804 <dt><a name=
"firstchild"></a><strong>firstchild
</strong> ()
</dt>
808 Alias the first (lowest order) page automatically
825 <dt><a name=
"form"></a><strong>form
</strong> (model)
</dt>
829 Create a CBI form model dispatching target.
837 model: CBI form model tpo be rendered
854 <dt><a name=
"get"></a><strong>get
</strong> (...)
</dt>
858 Fetch or create a dispatching node without setting the target module or
877 <h3>Return value:
</h3>
878 Dispatching tree node
887 <dt><a name=
"httpdispatch"></a><strong>httpdispatch
</strong> (request)
</dt>
891 Dispatch an HTTP request.
899 request: LuCI HTTP Request object
916 <dt><a name=
"lookup"></a><strong>lookup
</strong> (...)
</dt>
920 Lookup node in dispatching tree.
938 <h3>Return value:
</h3>
939 Node object, canonical url or nil if the path was not found.
948 <dt><a name=
"node"></a><strong>node
</strong> (...)
</dt>
952 Fetch or create a new dispatching node.
970 <h3>Return value:
</h3>
971 Dispatching tree node
980 <dt><a name=
"node_childs"></a><strong>node_childs
</strong> (node)
</dt>
984 Return a sorted table of visible children within a given node
1002 <h3>Return value:
</h3>
1003 Ordered table of child node names
1012 <dt><a name=
"node_visible"></a><strong>node_visible
</strong> (node)
</dt>
1016 Check whether a dispatch node shall be visible
1034 <h3>Return value:
</h3>
1035 Boolean indicating whether the node should be visible
1044 <dt><a name=
"rewrite"></a><strong>rewrite
</strong> (n, ...)
</dt>
1048 Rewrite the first x path values of the request.
1056 n: Number of path values to replace
1060 ...: Virtual path to replace removed path values with
1077 <dt><a name=
"template"></a><strong>template
</strong> (name)
</dt>
1081 Create a template render dispatching target.
1089 name: Template to be rendered
1106 <dt><a name=
"translate"></a><strong>translate
</strong> (text)
</dt>
1110 Access the luci.i18n translate() api.
1118 text: Text to translate
1139 </div> <!-- id="content" -->
1141 </div> <!-- id="main" -->
1144 <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>
1145 </div> <!-- id="about" -->
1147 </div> <!-- id="container" -->