ngsymfonytools: Twig and Symfony from legacy templates
This page is for developers of a site in transition from legacy templates to Symfony. ngsymfonytools (Netgen
Symfony Tools) lets legacy templates include Twig templates and run Symfony sub-requests, so legacy pages
can reuse Symfony or Ibexa-side pieces.
It only works in a legacy bridge setup, where the legacy kernel runs inside a Symfony application.
Operators
| Operator | What it does |
|---|---|
symfony_include | Includes a Twig template with parameters. |
symfony_path, symfony_url | A relative or absolute URL for a route, with the arguments of Twig's path and url. |
symfony_render | Renders a route as a sub-request. |
doc/USAGE.md of the extension describes all of them.
Example
{symfony_include(
'NetgenTestBundle:Test:test.html.twig',
hash(
'theAnswer', 42,
'homepage', fetch( 'content', 'node', hash( 'node_id', 2 ) )
)
)}Parameters that are eZContentObject or eZContentObjectTreeNode are converted to the API Content and Location
objects before they reach the Twig template.
What changed in the fork (March to April 2026)
- The package name and license in
composer.jsonare the se7enxweb ones, with areplacesection so it overrides cleanly. symfony_includeasked the container for the removedtemplatingservice (gone since Symfony 5), which threwServiceNotFoundException. It now uses thetwigservice. A workaround withTwig\Environment::classwas tried and reverted once the legacy bridge (v5.0.9) made thetwigservice public.- A
class_aliasshim loads the API content converter on both the oldeZ\Publish\API\Repository\Repositoryinterface and Ibexa DXP 5.0'sIbexa\Contracts\Core\Repository\Repository.
Related pages
- Legacy bridge
- Chronicle of the repository and release notes (covered with the platform repositories)
- Change ledger
- Behaviour changes of the extensions
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.