mirror of
https://github.com/lxsang/antd-web-apps
synced 2025-07-27 02:59:47 +02:00
allow controller to change view layout
This commit is contained in:
@ -27,6 +27,10 @@ function BaseController:redirect(url)
|
||||
std.header_flush()
|
||||
end
|
||||
|
||||
function BaseController:setLayout(name)
|
||||
self.registry.layout = name
|
||||
end
|
||||
|
||||
function BaseController:setSession(key, value)
|
||||
SESSION[key] = value
|
||||
end
|
||||
|
@ -75,7 +75,7 @@ function Router:delegate()
|
||||
end
|
||||
-- now require the main page to put the view
|
||||
|
||||
local fn, e = loadscript(WWW_ROOT..DIR_SEP.."index.ls")
|
||||
local fn, e = loadscript(VIEW_ROOT..DIR_SEP..self.registry.layout..DIR_SEP.."index.ls")
|
||||
html()
|
||||
if fn then
|
||||
local r,o = pcall(fn, views)
|
||||
|
Reference in New Issue
Block a user