切换搜索
搜索
切换菜单
notifications
切换个人菜单
查看“模块:Yesno”的源代码
来自星际公民中文百科
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:Yesno
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:确认用户
您可以查看和复制此页面的源代码。
-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- 如果你的维基使用非ASCII字符来表示 "是"、"否 "等等 -- 你应该在下面一行用 "mw.ustring.lower(val) "替换 "val:lower()"。 val = type(val) == 'string' and mw.ustring.lower(val) or val if val == nil then return nil elseif val == true or val == '是' or val == 'yes' or val == 'y' or val == 'true' or val == 't' or tonumber(val) == 1 then return true elseif val == false or val == '否' or val == 'no' or val == 'n' or val == 'false' or val == 'f' or tonumber(val) == 0 then return false else return default end end
本页使用的模板:
模板:Documentation
(
查看源代码
)
模板:Documentation/styles.css
(
查看源代码
)
模板:Hatnote/styles.css
(
查看源代码
)
模板:Mbox/styles.css
(
查看源代码
)
模板:Wikipedia template
(
查看源代码
)
模块:DPLlua
(
查看源代码
)
模块:DependencyList
(
查看源代码
)
模块:Documentation
(
查看源代码
)
模块:Enum
(
查看源代码
)
模块:Paramtest
(
查看源代码
)
模块:Yesno
(
查看源代码
)
模块:Yesno/doc
(
查看源代码
)
返回
模块:Yesno
。
Debug data: