Fluid - A fast and secure template engine

TYPO3 Fluid is a template engine for PHP. It is fast, secure and extensible.

The Fluid Template Engine is powering modern TYPO3 sites, as a quick way to customize HTML-based output for any PHP-based project.

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. 

A brief history

Originally part of TYPO3 Neos and TYPO3 Extbase and invented in 2008 during the TYPO3 Developer Days (first naming was beer3) by Bastian Waidelich and Sebastian Kurfürst, Fluid has conquered the TYPO3 world in the last years, and is now the basis for any rendering in Frontend output and the TYPO3 Administration interface. In 2016 Claus Due refactored the code base in a standalone package, which was then used as a library since TYPO3 v8, as well as Neos/Flow Framework.

Contribution and Maintenance

All development and open issues can be found on GitHub. Feel free to open tickets or submit a patch if you want to contribute.

Lead maintainer: Claus Due.

Current available adapters

If you've built bridge packages and adapters for other PHP frameworks feel free to contact Claus Due or Benni Mack, so we'll add it to this list.

Documentation

These are resources for getting started with the TYPO3 Fluid Template Engine on TYPO3:

Some of the resources teach developing extensions for TYPO3 with Extbase and Fluid. You can however use Fluid without Extbase as templating engine.

License

TYPO3 Fluid Template Engine is licensed under LPGL 3.0.