[luci] CBI: How do I filter based in the value of an option

Chris Martin chris at martin.cc
Tue Feb 16 09:06:28 CET 2010


I want to be able to display interfaces based on the "proto" option

I want to do something like the following:

m = map ("network", "title", "description")
s = m:section(TypedSection, "interface", "")
function s.filter(self, section)
       return somehow_get_the_option(self, section, "proto") == "gre"
end

I just can't figure out how to get the value of an option...
I am reading through cbi.lua but I really don't have a strong grip on it yet
Can some one please provide me with a pointer in the right direction.

Cheers
----------------------------------------------------------
Chris Martin
m: 0419812371
----------------------------------------------------------


More information about the luci mailing list