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 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.

Read more about the beginnings of Fluid.

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. Current stable branch is 2.6.x.

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

Get started and read all about TYPO3 Fluid Template Engine in TYPO3's Extbase + Fluid Guide.

The current reference for all available ViewHelpers in Fluid Engine, and TYPO3's Fluid Adapter (EXT:fluid) can be found on docs.typo3.org.

License

TYPO3 Fluid Template Engine is licensed under LPGL 3.0.