« SwitchExample » : différence entre les versions
(Page créée avec « {{SwitchTemplate field = type1 }} {{interlanguagelink:en|London}} ») |
m (Remplacement de texte — « ParserFunctions examples » par « ParserFunctions example ») |
||
(14 versions intermédiaires par 2 utilisateurs non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
This page uses the [[Template:SwitchTemplate]] template. | |||
{{SwitchTemplate | |||
| field = type1 | |||
}} | |||
{{SwitchTemplate | |||
|field=type2 | |||
}} | |||
{{SwitchTemplate | |||
| field = type 3 | |||
}} | |||
{{SwitchTemplate | |||
| field = type4 | |||
}} | |||
{{SwitchTemplate}} | |||
{{SwitchTemplate | {{SwitchTemplate | ||
field = | | field = UndefinedParameterValue | ||
}} | }} | ||
{{interlanguagelink:en|SwitchExample}} | |||
[[Category:ParserFunctions example]] | |||
{{interlanguagelink:en| |
Dernière version du 3 mai 2020 à 11:45
This page uses the Template:SwitchTemplate template.
An example of using the switch statement within a template.
The parameter value type1 works with padding spaces in both calling function and the template.
An example of using the switch statement within a template.
The parameter value type2 works without padding spaces in both calling function and the template.
An example of using the switch statement within a template.
The parameter value type 3 works. We can have spaces within the parameter value.
An example of using the switch statement within a template.
The fallthrough example works.
An example of using the switch statement within a template.
The default case applies if the parameter is not set, or if it is set to a value not defined in the switch statement.
An example of using the switch statement within a template.
The default case applies if the parameter is not set, or if it is set to a value not defined in the switch statement.