Project

General

Profile

Actions

Bug #71821

closed

f:switch includes all content aside of the f:case subtags

Added by Bernd Wilke almost 9 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2015-11-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

other than the f:if tag which renders only the subtags f:then and f:else (if they are used) the f:switch tags includes all content outside any f:case sub tags.
this results in a lot of whitespace if you just use some order in a switch. or all comments are included everytime:

example 1:

<f:if condition="{test}">
  // test is true
  <f:then>test is valid</f:then>

  // test is false
  <f:else>test is not valid</f:else>
</f:if>

assuming test is 2 the result will be:
test is valid

example 2:

<f:switch expression="{test}">
  // first case
  <f:case value="1"> test is 1</f:case>

  // second case
  <f:case value="2">test is 2</f:case>

  // others
  <f:case default="1">test is anything other</f:case>
</f:switch>

assuming test is 2 the result will be:


// first case

// second case
test is 2

// others

Actions

Also available in: Atom PDF