typo3fluid/fluid
typo3fluid/fluid is a standalone PHP templating engine and the rendering core behind TYPO3. It provides secure, logic-light HTML templates with layouts, partials, sections, view helpers, and caching for maintainable server-rendered views.
Architecture fit. Fluid is a server-side PHP templating engine that parses templates into an intermediate representation and compiles them to cached PHP classes for execution. Rendering is orchestrated through a RenderingContext, a View object, and TemplatePaths, with behavior extended via ViewHelpers — PHP classes exposed to templates through namespace registration. Fluid 5 adds strict argument validation (StrictArgumentProcessor), a <f:argument> mechanism, an Annotations API, and component-listing APIs, which materially raises the ceiling for typed, reusable component libraries. Architecturally this is a clean fit for a Laravel request→response pipeline: it operates strictly at the view-rendering layer, has no framework coupling, and no global state requirements beyond a cache directory.
Integration feasibility. There is no Laravel package here — no service provider, no Illuminate\Contracts\View\Factory implementation, no Blade bridge, no cache/queue/event adapters. Everything between Fluid and Laravel is code we own: a view finder, a cache store bridge, a container-aware ViewHelper resolver, and an exception-to-HTTP mapping. A functional spike rendering one real template is roughly one engineer-week; production hardening (escaping policy, cache warming, error surface, CI linting) is four to eight weeks of incremental work. This is feasible, but it is a build-and-own decision, not an install-and-configure decision.
Technical risk. Four items dominate:
Key questions.
Stack fit. Composer/PSR-4, no framework opinions, no conflicting transitive dependencies of note (the changelog shows only a symfony/polyfill-php84 shim). It composes cleanly with Laravel's container and filesystem abstractions — ViewHelpers can be resolved through the container rather than instantiated reflectively, which is the main design decision in the adapter.
Migration path. Deliberately bounded, coexistence-first:
.fluid.* file extension from day one. Fluid 5's resolution fallback chain (myTemplate.fluid.html → myTemplate.html → myTemplate, then case variants) is forgiving, but starting on the canonical extension avoids the ambiguity cost later and keeps the door open to a hard Fluid 5 requirement.Compatibility. For a greenfield adoption, pin the newest 5.x and accept the upgrade cadence. For teams needing a slower-moving base, 4.x is the safer landing zone. Avoid 2.x for anything new — it exists for legacy TYPO3 support. Use caret constraints with a committed lockfile, and treat minor-version bumps as scheduled work rather than automatic. Note that upstream's release cadence is high (multiple minors and patches across lines within a few months), so an unpinned or auto-updated dependency will generate unplanned churn.
Sequencing.
TemplatePaths + cache adapter.UnsafeHTML is permitted and who approves it, and CI linting using the 5.3 template analyzer to catch syntax errors pre-merge.Maintenance. We own the adapter permanently. Upstream is genuinely active and follows a disciplined deprecate-then-remove policy, which makes upgrades predictable but non-optional. Budget a recurring maintenance slot each quarter for version bumps, and track the changelog for deprecations on the line we pin. The compiled-template cache is the most likely source of routine operational surprises; cache-version-keying it to the deployment is table stakes.
Support. No commercial support contract and no first-party Laravel-oriented documentation. Docs are TYPO3-canonical and cross-reference TYPO3's ViewHelper reference, so engineers must filter for standalone usage. The realistic support model is internal ownership plus the upstream GitHub issue tracker and TYPO3 community channels. Budget for internal documentation of our integration layer — it will not exist upstream.
Scaling. Rendering is CPU-bound PHP; throughput is a function of compiled-template reuse, not horizontal scaling cleverness. Compile at build time or warm the cache on deploy, never on the request path. In multi-node deployments the cache must be either baked into the image or backed by shared storage — a per-node ephemeral cache means every node pays the compile cost and risks divergent behavior during rolling deploys.
Failure modes.
UnsafeHTML is a deliberate, necessary escape hatch, and therefore the primary XSS vector. It needs a review gate, not just documentation.Ramp-up. Fluid's syntax is readable to designers and learnable by engineers, but the full model — namespaces, layouts, sections, partials, ViewHelper argument definitions, scoped variables — is a real learning curve. Expect one to two sprints for a mid-level developer to reach productive autonomy, plus a short onboarding module for anyone authoring templates. The <f:argument> and strict-validation behavior differs subtly from Blade and from earlier Fluid versions, so training material must be version-specific.
How can I help you explore Laravel packages today?