[luci] luci grammar

子文 u8j9 at 163.com
Thu Jun 19 11:09:53 CEST 2014



 Dear
   I see net:adminlink(),  what is the function meaning of adminlink? and How can I get the description of the function from luci api  document?








At 2014-06-17 06:44:06, "Jo-Philipp Wich" <xm at subsignal.org> wrote:
>On 17.06.2014 06:36, 子文 wrote:
>> Dear
>>    uci:foreach("network", "interface",
>>         function (section)
>>             local ifc = section[".name"]
>>             if ifc ~= "loopback" then
>>                 entry({"admin", "network", "network", ifc},
>>                  true,
>>                  ifc:upper())
>>             end
>>         end
>>     )
>>       Sorry  , I can't still understand the setence " local ifc =
>> section[".name"]", why can it get the section name by using
>> section[".name"]"?
>
>
>For a uci section like:
>
>config interface lan
>  option ifname eth1
>  option proto pppoe
>  option username test
>  option password test
>
>The lua table looks like this:
>
>{
>   ".type" = "interface",
>   ".name" = "lan",
>   ".index" = 3,
>   ".anonymous" = false,
>   "ifname" = "eth1"
>   "proto" = "pppoe",
>   "username" = "test",
>   "password" = "test"
>}
>
>The ".type", ".name", ".index" and ".anonymous" fields are added by the
>UCI library and they're prefixed with a dot to not clash with any option
>value. The field ".name" (not "name") refers to the name from the
>"config type name" line in a UCI config.
>
>~ Jow
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20140619/3a28680d/attachment.html>


More information about the luci mailing list