Fluid and translation · Question 1 of 12
How do you output the value of the title property of the product object in a Fluid template?
1 answer is correct. Easy
Show answer
Answer
- B {product.title}
Explanation
In Fluid you write variables in single curly braces, and you reach object properties and array keys with a dot: {product.title}. For an object, Fluid calls the getter getTitle(). The output is HTML-escaped automatically, so special characters such as < are displayed safely and injected HTML code is not executed. Double curly braces come from Twig or Mustache and have no meaning in Fluid; PHP syntax such as $product->title is not possible in templates.