Module:Tmpl
Appearance
සැකිල්ල:Shared Template Warning
This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
Implements {{tmpl}}
.
භාවිතය
[සංස්කරණය]{{#invoke:Tmpl|renderTmpl}}
Tests
[සංස්කරණය]Module:Tmpl/testcases: success: 1, error: 0, skipped: 0
-- This is a helper module for Template:tmpl
local this = {}
function this.renderTmpl(frame)
local args = frame.args
local pargs = (frame:getParent() or {}).args
local result = pargs[0] or ''
for k, v in pairs(pargs) do
local n = tonumber(k) or -1
if (n >= 1 and n <= 9) then
result = mw.ustring.gsub( result, '$' .. n, mw.text.trim(v) )
end
end
return result
end
return this