typo3fluid/fluid
TYPO3Fluid is a standalone PHP templating engine from TYPO3, providing the Fluid syntax for building secure, reusable templates with view helpers, layouts, partials, and caching. Use it in any PHP project without the full TYPO3 CMS stack.
Full Changelog: https://github.com/TYPO3/Fluid/compare/5.2.0...5.3.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.5.1...4.6.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/5.1.1...5.2.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/5.1.0...5.1.1
<f:argument> does not work when rendering sections … by @s2b in https://github.com/TYPO3/Fluid/pull/1275Full Changelog: https://github.com/TYPO3/Fluid/compare/4.5.0...4.5.1
Full Changelog: https://github.com/TYPO3/Fluid/compare/5.0.3...5.1.0
<f:argument> does not work when rendering sections by @cundd in https://github.com/TYPO3/Fluid/pull/1274Full Changelog: https://github.com/TYPO3/Fluid/compare/5.0.2...5.0.3
Full Changelog: https://github.com/TYPO3/Fluid/compare/5.0.1...5.0.2
Full Changelog: https://github.com/TYPO3/Fluid/compare/5.0.0...5.0.1
Version 5.0 is the next major milestone in the development of the Fluid templating engine. Based on the previous efforts that went into Fluid 4, Fluid 5 continues to refactor and to modernize the underlining source code, which sometimes requires introducing strategic breaking changes. All breaking changes in this release have been pre-announced in Fluid 4, both in the changelog and by applying the [@deprecated](https://github.com/deprecated) annotation or emitting a deprecation notice in the code.
These breaking changes allow us to ship meaningful new features that weren't possible before:
ViewHelpers now use the StrictArgumentProcessor to validate ViewHelper arguments. This means that argument validation behaves the same with ViewHelpers and with the <f:argument> ViewHelper, which was introduced with Fluid 4.2. While the new validation might require some adjustments in existing projects, it has clear advantages: ViewHelper instances can actually rely on the types specified in their API to be checked properly by Fluid, which makes a lot of custom validation code obsolete.
The new argument validation adds support for union types as well as iterable, countable and callable, which allows ViewHelpers to define a clearer API.
See #1062, #1074, #1194 and #1226 for more details.
Fluid 5 now features an internal fallback chain for template file names. Template files are now resolved in the following order (first match wins):
templateRootPath: templates/
template: myTemplate
format: html
1. templates/myTemplate.fluid.html
2. templates/myTemplate.html
3. templates/myTemplate
4. templates/MyTemplate.fluid.html
5. templates/MyTemplate.html
6. templates/MyTemplate
This means that it's no longer necessary for template names to start with an uppercase character. Also, there is a new dedicated file extension *.fluid.* for Fluid templates: *.fluid.html instead of *.html, *.fluid.xml instead of *.xml, and so on. Because of the fallback chain, both can be added without breaking potential overrides from other template paths.
We recommend switching to the new file extension if Fluid 5 can be a hard requirement for your project. Otherwise, just stick to the existing general file extensions. The new file extension is entirely optional and will not be a requirement.
See #1243 and #1258 for more details.
Fluid 5 comes with a much simpler way to warmup the template cache in your project. The existing cache warmup functionality has been removed and replaced by a new implementation that requires much less configuration and context. By default, it makes use of the new *.fluid.* file extension to discover all Fluid templates in your project.
bin/fluid warmup \
--cacheDirectory examples/cache/ \
--path examples/Resources/
--path examples/ResourceOverrides/
See #1224 for more details.
A long-standing issue in Fluid templates has been that the Fluid variable and inline ViewHelper syntax collides with inlined CSS or JavaScript code. This issue has now been addressed with Fluid 5: A new alternative syntax has been introduced that makes collisions between CSS/JavaScript and Fluid far less likely.
The normal inline and variable syntax uses single curly braces { } as tokens in Fluid templates. In <![CDATA[ ]]> sections, this syntax are now ignored. Instead, three curly braces {{{ }}} can be used to call Fluid ViewHelpers or to access variables. The tag-based syntax is disabled altogether in CDATA sections.
See #1246 and the documentation for more details: Avoiding syntax collision with JS and CSS.
Please refer to the documentation for a full list of breaking changes and newly introduced deprecations in Fluid 5.0: Changelog 5.x.
Please note that some of the listed changes have been backported to Fluid 4.5.0, most importantly all new ViewHelpers.
ChainedVariableProvider::get by @sascha-egerer in https://github.com/TYPO3/Fluid/pull/1165f:max ViewHelper by @eliashaeussler in https://github.com/TYPO3/Fluid/pull/1254Full Changelog: https://github.com/TYPO3/Fluid/compare/4.5.0...5.0.0
Fluid 4.5 makes advances in two areas: It contains a range of new ViewHelpers that should make the life of integrators easier. Also, it includes deprecations in preparation for the upcoming Fluid 5.0, which will contain various breaking changes.
New ViewHelpers in Fluid 4.5:
<f:range> creates an array containing the specified range of integers<f:length> returns the length of a given string<f:merge> merges two given arrays into one<f:startsWith> and <f:endsWith> check if a given string starts or ends with another string<f:round>, <f:ceil> and <f:floor> provide various ways to round floats<f:min> and <f:max> return the minimum/maximum value in the given array<f:contains> checks if a given array/string contains the given valueThe deprecations and preparations for the upcoming Fluid 5.0 are listed in the documentation: Changelog 4.x
ChainedVariableProvider::get (#1165) by @lolli42 in https://github.com/TYPO3/Fluid/pull/1187Full Changelog: https://github.com/TYPO3/Fluid/compare/4.4.3...4.5.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.4.2...4.4.3
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.4.1...4.4.2
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.4.0...4.4.1
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.3.0...4.4.0
Fluid 4.3 introduces the concept of components to Fluid. Components are custom HTML-like tags based on Fluid templates that you can reuse throughout your project. The concept is similar to popular frontend frameworks like React and Vue or native Web Components, but they are server-rendered by PHP.
In addition to the user-facing components feature, new low-level APIs have been introduced which potentially allow Fluid to interact with other templating engines.
Both aspects are explained in detail in the documentation:
Thank you to all members of the TYPO3 Association who voted for the community budget idea and made this release possible! ❤️
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.2.0...4.3.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.1.2...4.2.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.1.1...4.1.2
dev-main by @sbuerk in https://github.com/TYPO3/Fluid/pull/1055Full Changelog: https://github.com/TYPO3/Fluid/compare/4.1.0...4.1.1
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.0.3...4.1.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.0.2...4.0.3
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.0.1...4.0.2
Full Changelog: https://github.com/TYPO3/Fluid/compare/4.0.0...4.0.1
Nearly eight years after the launch of Fluid v2, we are happy to release Fluid v4. For this major version we had one key goal in mind: no breaking changes to user-facing APIs, such as ViewHelpers or View classes. We are confident that we have achieved this goal.
In this release, we focused on improving code quality by introducing stricter type checks across most of the codebase. In addition, we have deprecated several outdated or suboptimal APIs – most notably, the renderStatic() method for ViewHelpers and the related traits. While these deprecated APIs remain functional in Fluid v4, they will be removed in the upcoming Fluid v5 release. We strongly encourage users to consult the deprecation log and update their code to ensure compatibility with future versions.
To make the upgrade process as seamless as possible, we've backported many of the new features to Fluid v2, ensuring that the migration path is largely backward-compatible.
Noteworthy features in v4 that could not be backported:
<f:comment> now ignores Fluid syntax errors{true}, {false} and {null} are part of the language now and can be used in all templatesAbstractTagBasedViewHelper now supports boolean tag arguments according to the HTML5 standardA full list of breaking changes is available in the documentation.
Full Changelog: https://github.com/TYPO3/Fluid/compare/2.15.0...4.0.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/2.14.1...2.15.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/2.14.0...2.14.1
Full Changelog: https://github.com/TYPO3/Fluid/compare/2.13.0...2.14.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/2.12.0...2.13.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/2.11.0...2.12.0
as argument of CycleViewHelper to string by @Teddytrombone in https://github.com/TYPO3/Fluid/pull/854Full Changelog: https://github.com/TYPO3/Fluid/compare/2.10.1...2.11.0
Full Changelog: https://github.com/TYPO3/Fluid/compare/2.10.0...2.10.1
How can I help you explore Laravel packages today?