Key Features
- Secure by default: Anything that is added or extended is properly escaped by default to prevent common XSS (Cross Site Scripting) mistakes.
- Extensible: Fluid's power under the hood comes via variables and "ViewHelpers" to add custom logic within PHP ready to re-use in any template.
- Built on top of XML: If you're comfortable with HTML, you'll notice Fluid solely as a slim super-set on top of HTML, just some special XML tags in your templates.
Example
This is how Fluid templates look like:
<h4>Template it your own way</h4>
<p>
<f:if condition="{myExpression}">
<f:then><strong>Yay</strong></f:then>
<f:else>Nay</f:else>
</f:if>
</p>
... will be transformed into ...
<h4>Template it your own way</h4>
<p><strong>Yay</strong></p>
... depending on variables in your template.
Of course, you have conditions, loops, PHP object and PHP array handling support built-in.