diff options
author | Steven Barth <steven@midlink.org> | 2008-09-01 20:43:48 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-09-01 20:43:48 +0000 |
commit | 06b6d23c20c8cb01923b7430739199b413926ec0 (patch) | |
tree | 7d45191015c80cd291616fc46f2ba1a8d6ad5774 | |
parent | 3568e2ba5097a5157c08f608e2bafa3d60c1f943 (diff) |
Added custom filename support to luci.template
-rw-r--r-- | libs/web/luasrc/template.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua index c656cee8d..e78bfb695 100644 --- 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 -function Template.__init__(self, name) +function Template.__init__(self, name, srcfile, comfile) 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 sourcefile = viewdir .. "/" .. name .. ".htm" - local compiledfile = cdir .. "/" .. _encode_filename(name) .. ".lua" + local sourcefile = srcfile or (viewdir .. "/" .. name .. ".htm") + local compiledfile = comfile or (cdir .. "/" .. _encode_filename(name) .. ".lua") local err if compiler_mode == "file" then |