打开/关闭搜索
搜索
打开/关闭菜单
17
78
34
2.1K
INFWiki
导航
百科首页
最近更改
随机页面
特殊页面
上传文件
人气页面
入服指南
回响地标
百科创作
介绍
语法
打开/关闭外观设置菜单
notifications
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
登录
查看“︁模块:Yesno”︁的源代码
来自INFWiki
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
Yesno
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
-- Imported from: https://en.wikipedia.org/wiki/Module:Yesno -- 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 "string.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 val == 'ja' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or val == 'nein' or tonumber(val) == 0 then return false else return default end end
该页面使用的模板:
Yesno/doc
(
查看源代码
)
返回
Yesno
。
查看“︁模块:Yesno”︁的源代码
来自INFWiki