查看“模块:Yesno”的源代码
←
模块: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 "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 val == '是' or val == '开' or val == '開' 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 == '否' or val == '关' or val == '關' or tonumber(val) == 0 then return false else return default end end
该页面使用的模板:
模块:Yesno/doc
(
查看源代码
)
返回至“
模块:Yesno
”。
导航菜单
个人工具
登录
名字空间
模块
讨论
变体
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
检索
作品
人物
地点
文化
石心之壁
石心之壁
游戏资源
日历
工具
链入页面
相关更改
特殊页面
页面信息