Module:If
From Little Tail Wiki
Documentation for this module may be created at Module:If/doc
local p = {}
function p.main( frame )
local tArgs = frame:getParent()
if not(tArgs.args[1]) then
tArgs = frame
end
local sText = tArgs.args[1]
local sTrueAction = tArgs.args[2] or tArgs.args["true"]
local sFalseAction = tArgs.args[3] or tArgs.args["false"]
if sText == "" then
sText = mw.getCurrentFrame():preprocess(sFalseAction)
else
sText = mw.getCurrentFrame():preprocess(sTrueAction)
end
return sText
end
return p