1 -- This is a very simple example Hello World FFLuCI controller
2 -- See the other examples for more automated controllers
4 -- Initialise Lua module system
5 module(..., package.seeall)
7 -- This is the module dispatcher. It implements the last step of the
8 -- dispatching process.
9 function dispatcher(request)
10 require("ffluci.template").render("header")
11 print("<h2>Hello World!</h2>")
12 for k,v in pairs(request) do
13 print("<div>" .. k .. ": " .. v .. "</div>")
15 require("ffluci.template").render("footer")
18 -- The following part is optional it could be useful for menu generators
19 -- An example menu generator is implemented in the template "menu"
22 -- This is the menu item description
23 descr = "Hello World",
25 -- This is the order level of the menu entry (lowest goes first)
28 -- A list of menu entries in the form action => "description"
30 {action = "index", descr = "Hello World"},