projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3568e2b
)
Added custom filename support to luci.template
author
Steven Barth
<steven@midlink.org>
Mon, 1 Sep 2008 20:43:48 +0000
(20:43 +0000)
committer
Steven Barth
<steven@midlink.org>
Mon, 1 Sep 2008 20:43:48 +0000
(20:43 +0000)
libs/web/luasrc/template.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/template.lua
b/libs/web/luasrc/template.lua
index
c656cee
..
e78bfb6
100644
(file)
--- a/
libs/web/luasrc/template.lua
+++ b/
libs/web/luasrc/template.lua
@@
-139,7
+139,7
@@
Template.cache = setmetatable({}, {__mode = "v"})
-- Constructor - Reads and compiles the template on-demand
-- Constructor - Reads and compiles the template on-demand
-function Template.__init__(self, name
)
+function Template.__init__(self, name
, srcfile, comfile)
local function _encode_filename(str)
local function __chrenc( chr )
local function _encode_filename(str)
local function __chrenc( chr )
@@
-177,8
+177,8
@@
function Template.__init__(self, name)
local cdir = compiledir .. "/" .. sys.process.info("uid")
-- Compile and build
local cdir = compiledir .. "/" .. sys.process.info("uid")
-- Compile and build
- local sourcefile =
viewdir .. "/" .. name .. ".htm"
- local compiledfile = c
dir .. "/" .. _encode_filename(name) .. ".lua"
+ local sourcefile =
srcfile or (viewdir .. "/" .. name .. ".htm")
+ local compiledfile = c
omfile or (cdir .. "/" .. _encode_filename(name) .. ".lua")
local err
if compiler_mode == "file" then
local err
if compiler_mode == "file" then