Module:Sandbox/BrandonXLF/1: Difference between revisions

Content deleted Content added
Use empty table by default
No edit summary
Line 1:
function main (frame, switch)
local args1fArgs = frame:getParent().args or {}
local args2pArgs = frame:getParent().args or {}
local template = args2fArgs['_']
args2._ = nil
if switch then
args1, args2 = args2, args1
end
if not template then
return require('Module:Error').error({'Error: no template name given.'})
end
args2fArgs._ = nil
for k,v in pairs(args1) do
if switch then
args2[k] = v
pArgs, fArgs = fArgs, pArgs
end
for k,v in pairs(args1pArgs) do
args2fArgs[k] = v
end
return frame:expandTemplate{title = template, args = args2fArgs}
end