diff --git a/info/controllers/IndexController.lua b/info/controllers/IndexController.lua index bff7ae5..aadf8c6 100644 --- a/info/controllers/IndexController.lua +++ b/info/controllers/IndexController.lua @@ -58,9 +58,9 @@ function IndexController:pdf(...) if r then local mime = std.mimeOf(tmp_file) std.header(mime) - std.fb(tmp_file) + std.f(tmp_file) return false else return self:error("Sorry.Problem generate PDF file") end -end +end \ No newline at end of file diff --git a/info/router.lua b/info/router.lua index 94fd8c9..c25cae7 100644 --- a/info/router.lua +++ b/info/router.lua @@ -54,6 +54,18 @@ local default_routes_dependencies = { } } router:route('default', default_routes_dependencies ) + +BaseController:subclass("NotfoundController",{ registry = {}, models = {} }) + +function NotfoundController:index(...) + local args = {...} + local user = args[1]:gsub("Controller", ""):lower(); + REQUEST.r = "index" + if REGISTRY.db then REGISTRY.db:close() end + REGISTRY.db = DBHelper:new{db = user} + REGISTRY.db:open() + router:delegate() +end router:delegate() if REGISTRY.db then REGISTRY.db:close() end diff --git a/silk/DBHelper.lua b/silk/DBHelper.lua index e9d0ab9..bd41bf3 100644 --- a/silk/DBHelper.lua +++ b/silk/DBHelper.lua @@ -71,7 +71,6 @@ function DBHelper:find(tbl, cond) sel = table.concat(cond.fields, ",") --print(sel) end - --print(cnd) local data = sqlite.select(self.db, tbl, sel, cnd) if data == nil then return nil end local a = {}