Template:Switch

International Game Developers Association

Jump to: navigation, search


Usage

A switch statement is defined like so:

{{Switch
|{{{field_name}}}
|case: Hello=Bonjour
|case: Goodbye=Adios
|default=Auf Wiedersehen
}}

In this case these inputs will render the outputs:

  • Hello = Bonjour
  • Goodbye = Adios
  • 1 = Auf Wiedersehen
  • HELLO = Auf Wiedersehen

It is string-specific (ie; the test is length, content and case specific). You can have as many cases as you like, and the default option is optional (if there is no default then it will produce nothing back).

Personal tools