1.文档结构
在openwrt源代码目录 /openwrt/feeds/luci/applications/下创建文件夹luci-myapplication。文件夹必须以luci-开头以便make menuconfig识别。按如下目录创建文件夹及文件。
luci-myapplication
|---luasrc
| |---controller
| | |---new_tab.lua
| |---model
| | |---cbi
| | |---cbi_tab.lua
| |---view
| |---view_tab.htn
|---Makefile
|---root
|---etc
|---config
|---cbi_file
2.文件内容
2.1 luci-myapplication/luasrc/controller/new_tab.lua
module("luci.controller.myapp.new_tab", package.seeall) --notice that new_tab is the name of the file new_tab.lua
function index()
entry({"admin", "new_tab"}, firstchild(), "New tab", 60).dependent=false --this adds the top level tab and defaults to the first sub-tab (tab_from_cbi), also it is set to position 30