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.

Certifications & exams

Which exam comes next?

You can already practise for 19 exams, and 21 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications