Anonymous user
Template:Boolean/doc: Difference between revisions
m
→Usage
imported>Ttv pedro270707 (Created page with "This template parses a boolean value. It should generally be used in other templates. == Usage == This template takes <code>1</code>, <code>true</code>, <code>yes</code> and <code>y</code> and parses them into <code>y</code>, and any other strings into <code>n</code>. The parsed values are regularly used in this wiki. {| class="wikitable" ! Code !! Output |- |<code><nowiki>{{boolean|1}}</nowiki></code> || {{boolean|1}} |- |<code><nowiki>{{boolean|true}}</nowiki></code>...") |
imported>Ttv pedro270707 m (→Usage) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This template parses a boolean value. It should generally be used in other templates. | This template parses a boolean value. It should generally be used in other templates. | ||
== Arguments == | |||
{| class="wikitable" | |||
! Argument !! Note | |||
|- | |||
|<code>1</code> || The passed boolean. | |||
|- | |||
|<code>string</code> || Sets if the original string should be returned if the passed value is not any of the accepted booleans. Returns <code>n</code> if a string is passed and this is set to a false value (or unset). | |||
|} | |||
== Usage == | == Usage == | ||
This template takes <code>1</code>, <code>true</code>, <code>yes</code> and <code>y</code> and parses them into <code>y</code>, and any other strings into <code>n</code>. The parsed values are regularly used in this wiki. | This template takes <code>1</code>, <code>true</code>, <code>yes</code> and <code>y</code> and parses them into <code>y</code>, and any other strings into <code>n</code>. The parsed values are regularly used in this wiki. | ||
Line 23: | Line 31: | ||
|- | |- | ||
|<code><nowiki>{{boolean|This is not a boolean}}</nowiki></code> || {{boolean|This is not a boolean}} | |<code><nowiki>{{boolean|This is not a boolean}}</nowiki></code> || {{boolean|This is not a boolean}} | ||
|- | |||
|<code><nowiki>{{boolean|This is not a boolean|string=y}}</nowiki></code> || {{boolean|This is not a boolean|string=y}} | |||
|- | |||
|<code><nowiki>{{boolean|true|string=y}}</nowiki></code> || {{boolean|true|string=y}} | |||
|} | |} |