[luci] how to pass parameter to wifi.lua
子文
u8j9 at 163.com
Sun Mar 27 15:09:45 CEST 2016
Dear All
I add a entry as following
entry(
{"admin", "network", "wireless", "param1/param2"},
alias("admin", "network", "wireless"),
"sunbin"
)
then I add debug information on wifi.lua as following. i found arg[1]=param1, arg=[2]=param2 . Why the value of arg[0] have no value?
arg[0] = arg[0] or ""
arg[1] = arg[1] or ""
arg[2] = arg[2] or ""
file = io.open("//tmp//sunbin.txt", "w+")
file:write(arg[0] .. ":" .. arg[1] .. ":" .. arg[2])
file:close()
At 2016-03-27 00:20:56, "Deric Panet-Raymond" <dpraymond at satcomdirect.com> wrote:
Parameters are passed in the URL by appending /<param1>/<param2> to the base url for that page.
You can reference any additional parameters using the arg[x] numbers. Just make sure you initialize to "" at the top so if there is no additional parameters you don't generate a null reference and break your page
Sent from my phone
On Mar 26, 2016, at 11:15 AM, 子文 <u8j9 at 163.com> wrote:
Dear all
There are a parameter named arg[1] in file model/cbi/admin_network/wifi.lua. I want to know how the luci pass the parameter to wifi.lua such as wifi0.network1
_______________________________________________
luci mailing list
luci at lists.subsignal.org
https://lists.subsignal.org/mailman/listinfo/luci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20160327/475733d6/attachment.html>
More information about the luci
mailing list