mirror of
https://github.com/lxsang/antd-web-apps
synced 2024-11-20 02:18:20 +01:00
35 lines
538 B
Lua
35 lines
538 B
Lua
|
|
||
|
--define the class
|
||
|
Router = Object:extends{registry = {}}
|
||
|
function Router:setPath(path)
|
||
|
self.path = path
|
||
|
end
|
||
|
|
||
|
function Router:initialize()
|
||
|
self.args = {}
|
||
|
self.routes = {}
|
||
|
end
|
||
|
|
||
|
function Router:setArgs(args)
|
||
|
self.args = args
|
||
|
end
|
||
|
|
||
|
function Router:arg(name)
|
||
|
return self.args[name]
|
||
|
end
|
||
|
|
||
|
function Router:getController(url)
|
||
|
-- TODO
|
||
|
end
|
||
|
|
||
|
function Router:delegate()
|
||
|
-- TODO
|
||
|
end
|
||
|
|
||
|
|
||
|
function Router:setInitRoute(name, url, visibility)
|
||
|
self.routes[name] = {
|
||
|
url = url,
|
||
|
visibility = visibility
|
||
|
}
|
||
|
end
|