View source for Module:Yesno
Appearance
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
000
1:0
Templates used on this page:
- Template:Module other (view source)
- Template:Module rating (view source)
- Template:Ombox (view source)
- Template:Sandbox other (view source)
- Template:Template link (view source)
- Template:Tl (view source)
- Template:Used in system (view source)
- Module:Arguments (view source)
- Module:Effective protection level (view source)
- Module:High-use (view source)
- Module:Message box (view source)
- Module:Message box/configuration (view source)
- Module:No globals (view source)
- Module:String (view source)
- Module:Transclusion count (view source)
- Module:Transclusion count/data/Y (view source)
- Module:Yesno (view source)
- Module:Yesno/doc (view source)
Return to Module:Yesno.