libs/web: use new parser in non-caching mode
This commit is contained in:
parent
80a2dd2cc2
commit
3e0b6b681c
1 changed files with 2 additions and 6 deletions
|
@ -32,6 +32,7 @@ local string = require "string"
|
||||||
local config = require "luci.config"
|
local config = require "luci.config"
|
||||||
local coroutine = require "coroutine"
|
local coroutine = require "coroutine"
|
||||||
local nixio = require "nixio", require "nixio.util"
|
local nixio = require "nixio", require "nixio.util"
|
||||||
|
local tparser = require "luci.template.parser"
|
||||||
|
|
||||||
local tostring, pairs, loadstring = tostring, pairs, loadstring
|
local tostring, pairs, loadstring = tostring, pairs, loadstring
|
||||||
local setmetatable, loadfile = setmetatable, loadfile
|
local setmetatable, loadfile = setmetatable, loadfile
|
||||||
|
@ -206,12 +207,7 @@ function Template.__init__(self, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif compiler_mode == "memory" then
|
elseif compiler_mode == "memory" then
|
||||||
local source
|
self.template, _, err = tparser.parse(sourcefile .. ".htm")
|
||||||
source, err = fs.readfile(sourcefile) or fs.readfile(sourcefile .. ".htm")
|
|
||||||
if source then
|
|
||||||
self.template, err = compile(source)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If we have no valid template throw error, otherwise cache the template
|
-- If we have no valid template throw error, otherwise cache the template
|
||||||
|
|
Loading…
Reference in a new issue