Module:Sandbox/BrandonXLF/1: Difference between revisions

Content deleted Content added
No edit summary
Reverted to revision 877044953 by BrandonXLF (Reverter)
Line 1:
local p = {}
function p.main (frame)
local fArgs = frame.args -- Frame arguments
local pArgs = frame:getParent().args -- Parent arguments
local templatetArgs = fArgs._t{}
local template = fArgs['_t'] -- Get template name
local pFirst = require('Module:Yesno')(fArgs._pf)
if nottemplate == '' or template == nil then return
return require('Module:Error').error({'Error: no template name given.'}) -- Template name is needed
end
--if pFirst then
-- fArgs, pArgs = pArgs, fArgs
--end
for k,v in pairs(fArgs) do
pArgstArgs[k] = v -- Add pArgs to tArgs
end
for k,v in pairs(fArgs) do
return 'pArgs:'..table.concat(pArgs or {})..' fArgs:'..table.concat(fArgs or {})..' pFirst:'..(pFirst or 'nil')..' template:'..template..' result:'..frame:expandTemplate{title = template, args = pArgs}
if k ~= '_t' then -- Do not count fArgs['_t'] as a parameter
tArgs[k] = v -- Add fArgs to tArgs
end
--end
return frame:expandTemplate{title = template, args = tArgs} -- Call template
end
return p