Module:Yesno: திருத்தங்களுக்கு இடையிலான வேறுபாடு
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
Add inline comments |
get arguments from the parent frame if the current frame doesn't have any |
||
வரிசை 1:
local p = {}
function p.yesno(
-- defaults
வரிசை 12:
-- Allow arguments to override defaults.
-- 'any' tracks the presence of any arguments at all.
local args = frame.args
local any = false
for k,v in pairs(
any = true
retvals[k] = v
end
-- If there are no arguments, try and get them from the parent frame.
if any == false then
local pframe = frame:getParent()
args = pframe.args
for k,v in pairs(args) do
any = true
retvals[k] = v
end
end
val =
-- According to the template docs, the input should be considered nil
| |||