.. include:: ../../../Includes.txt .. _typo3-fluid-switch: ====== switch ====== Switch view helper which can be used to render content depending on a value or expression. Implements what a basic switch()-PHP-method does. Examples ======== Simple Switch statement:: Mr. Mrs. Mrs. or Mr. Output:: Mr. / Mrs. (depending on the value of {person.gender}) or if no value evaluates to TRUE, defaultCase Note: Using this view helper can be a sign of weak architecture. If you end up using it extensively you might want to consider restructuring your controllers/actions and/or use partials and sections. E.g. the above example could be achieved with and the partials "title.male.html", "title.female.html", ... Depending on the scenario this can be easier to extend and possibly contains less duplication. Arguments ========= .. _switch_expression: expression ---------- :aspect:`DataType` mixed :aspect:`Required` true :aspect:`Description` Expression to switch