end
end
+function nb:ngx_rows(url)
+ local json = require('json')
+ local rows = json.decode(ngx.location.capture(url).body)
+
+ if not rows then rows = {} end
+
+ local count = 0 for _,row in pairs(rows) do count = count+1 end
+ local langs = {}
+ local count = 0 for _,row in pairs(rows) do
+ local lang = rows.lang
+ --langs[lang] = rows.lang
+ end
+
+ return {
+ data = rows,
+ count = count,
+ }
+end
+
function nb:ngx_tmpl_file(file,fheader,ffooter)
ngx.ctx.tmpl_content = self:readall(file)
self:ngx_location_tmpl(fheader,ffooter)