[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> Change-Id: Ib9468cdabd66fb8b484cb4d07520d5b529548dd1 Resolves: #49371 Documentation: #54283 Releases: 6.2 Reviewed-on: https://review.typo3.org/26058 Reviewed-by: Benjamin Kott Tested-by: Benjamin Kott Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring
Showing
- typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php 10 additions, 4 deletionstypo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
- typo3/sysext/fluid/Classes/ViewHelpers/SwitchViewHelper.php 2 additions, 1 deletiontypo3/sysext/fluid/Classes/ViewHelpers/SwitchViewHelper.php
- typo3/sysext/fluid/Tests/Unit/ViewHelpers/CaseViewHelperTest.php 60 additions, 0 deletions...ysext/fluid/Tests/Unit/ViewHelpers/CaseViewHelperTest.php
Please register or sign in to comment