ddf534b3e1e8f140b7a0f37f1eadbb29d93a586f
[project/luci.git] / modules / luci-base / luasrc / dispatcher.luadoc
1 ---[[
2 LuCI web dispatcher.
3 ]]
4 module "luci.dispatcher"
5
6 ---[[
7 Build the URL relative to the server webroot from given virtual path.
8
9 @class function
10 @name build_url
11 @param ...      Virtual path
12 @return                 Relative URL
13 ]]
14
15 ---[[
16 Check whether a dispatch node shall be visible
17
18 @class function
19 @name node_visible
20 @param node     Dispatch node
21 @return         Boolean indicating whether the node should be visible
22 ]]
23
24 ---[[
25 Return a sorted table of visible childs within a given node
26
27 @class function
28 @name node_childs
29 @param node     Dispatch node
30 @return         Ordered table of child node names
31 ]]
32
33 ---[[
34 Send a 404 error code and render the "error404" template if available.
35
36 @class function
37 @name error404
38 @param message  Custom error message (optional)
39 @return                 false
40 ]]
41
42 ---[[
43 Send a 500 error code and render the "error500" template if available.
44
45 @class function
46 @name error500
47 @param message  Custom error message (optional)#
48 @return                 false
49 ]]
50
51 ---[[
52 Dispatch an HTTP request.
53
54 @class function
55 @name httpdispatch
56 @param request  LuCI HTTP Request object
57 ]]
58
59 ---[[
60 Dispatches a LuCI virtual path.
61
62 @class function
63 @name dispatch
64 @param request  Virtual path
65 ]]
66
67 ---[[
68 Generate the dispatching index using the native file-cache based strategy.
69
70
71 @class function
72 @name createindex
73 ]]
74
75 ---[[
76 Create the dispatching tree from the index.
77
78 Build the index before if it does not exist yet.
79
80 @class function
81 @name createtree
82 ]]
83
84 ---[[
85 Register a tree modifier.
86
87 @class function
88 @name modifier
89 @param  func    Modifier function
90 @param  order   Modifier order value (optional)
91 ]]
92
93 ---[[
94 Clone a node of the dispatching tree to another position.
95
96 @class function
97 @name assign
98 @param  path    Virtual path destination
99 @param  clone   Virtual path source
100 @param  title   Destination node title (optional)
101 @param  order   Destination node order value (optional)
102 @return                 Dispatching tree node
103 ]]
104
105 ---[[
106 Create a new dispatching node and define common parameters.
107
108 @class function
109 @name entry
110 @param  path    Virtual path
111 @param  target  Target function to call when dispatched.
112 @param  title   Destination node title
113 @param  order   Destination node order value (optional)
114 @return                 Dispatching tree node
115 ]]
116
117 ---[[
118 Fetch or create a dispatching node without setting the target module or
119 enabling the node.
120
121 @class function
122 @name get
123 @param  ...             Virtual path
124 @return                 Dispatching tree node
125 ]]
126
127 ---[[
128 Fetch or create a new dispatching node.
129
130 @class function
131 @name node
132 @param  ...             Virtual path
133 @return                 Dispatching tree node
134 ]]
135
136 ---[[
137 Lookup node in dispatching tree.
138
139 @class function
140 @name lookup
141 @param  ...             Virtual path
142 @return Node object, canonical url or nil if the path was not found.
143 ]]
144
145 ---[[
146 Alias the first (lowest order) page automatically
147
148
149 @class function
150 @name firstchild
151 ]]
152
153 ---[[
154 Create a redirect to another dispatching node.
155
156 @class function
157 @name alias
158 @param  ...             Virtual path destination
159 ]]
160
161 ---[[
162 Rewrite the first x path values of the request.
163
164 @class function
165 @name rewrite
166 @param  n               Number of path values to replace
167 @param  ...             Virtual path to replace removed path values with
168 ]]
169
170 ---[[
171 Create a function-call dispatching target.
172
173 @class function
174 @name call
175 @param  name    Target function of local controller
176 @param  ...             Additional parameters passed to the function
177 ]]
178
179 ---[[
180 Create a template render dispatching target.
181
182 @class function
183 @name template
184 @param  name    Template to be rendered
185 ]]
186
187 ---[[
188 Create a CBI model dispatching target.
189
190 @class function
191 @name cbi
192 @param  model   CBI model to be rendered
193 ]]
194
195 ---[[
196 Create a combined dispatching target for non argv and argv requests.
197
198 @class function
199 @name arcombine
200 @param trg1     Overview Target
201 @param trg2     Detail Target
202 ]]
203
204 ---[[
205 Create a CBI form model dispatching target.
206
207 @class function
208 @name form
209 @param  model   CBI form model tpo be rendered
210 ]]
211
212 ---[[
213 Access the luci.i18n translate() api.
214
215 @class  function
216 @name   translate
217 @param  text    Text to translate
218 ]]
219
220 ---[[
221 No-op function used to mark translation entries for menu labels.
222
223 This function does not actually translate the given argument but
224 is used by build/i18n-scan.pl to find translatable entries.
225
226 @class function
227 @name _
228 ]]
229