Fluid and translation · Question 10 of 12
A button should get the class active or inactive depending on whether {conference.online} is true. Which notation is correct?
1 answer is correct. Medium
Show answer
Answer
- B class="{f:if(condition: conference.online, then: 'active', else: 'inactive')}"
Explanation
Condition ViewHelpers such as f:if have the arguments then and else, so they can be used inline in attributes. Inline calls need named arguments, the syntax has no positional values. A tag inside an attribute makes the HTML invalid, and the else branch is missing.