Hello!
I am newbie in LuCI (but not in sw development) and tried to understand how it works Sorry for my dumb questions..
Is it possible to call function defined in my module from another module?
I created a function, registered it with entry() in my module index() and would like to call it as target for page from another module. But I've got error "Cannot resolve function"..
my module code:
module("luci.controller.zgroject.zgmodule", package.seeall)
function select_slider()
luci.http.prepare_content("text/plain")
luci.http.write("Haha, rebooting now...")
end
function index()
entry({"zgproject","select_slider"}, call("select_slider"), "SelectSlider" , 80).dependent=false
end
and
I tried to call it from /admin/index.lua
page.target = call("zgproject/select_slider")
Error
Failed to execute call dispatcher target for entry '/zgproject'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:818: Cannot resolve function "zgproject/select_slider". Is it misspelled or local?
stack traceback:
[C]: in function 'assert'
/usr/lib/lua/luci/dispatcher.lua:818: in function </usr/lib/lua/luci/dispatcher.lua:816>
With best regards,
Vasily