[FEATURE] Fallback/default case for SwitchViewhelper 39/23739/11
authorJan Kiesewetter <jan@t3easy.de>
Sun, 27 Oct 2013 10:22:44 +0000 (11:22 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 8 Dec 2013 13:50:38 +0000 (14:50 +0100)
commit8e022bcbea4f7775ce10fee30b4682a6047c461c
tree4c79b0c8cf3116f3682ea149cfc48c8a50d2e945
parent8b3284cadf576e6a610b60d18b88ec0bf2b440bb
[FEATURE] Fallback/default case for SwitchViewhelper

In order to provide the full functionality known from the
switch/case PHP function, a default case possibility is
introduced. Use it like:
<f:switch expression="{person.gender}">
  <f:case value="female">Mrs.</f:case>
  <f:case value="male">Mr.</f:case>
  <f:case default="TRUE">Mrs. or Mr.</f:case>
</f:switch>

Resolves: #49371
Documentation: #54283
Change-Id: I6b71ec39173ab957aa392bd595a65ceddadc81c9
Releases: 6.2
Reviewed-on: https://review.typo3.org/23739
Reviewed-by: Cedric Ziel
Tested-by: Cedric Ziel
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/SwitchViewHelper.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/CaseViewHelperTest.php