Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

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…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/features/6.0/extensions/ngsymfonytools.md

On this page

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

OperatorWhat it does
symfony_includeIncludes a Twig template with parameters.
symfony_path, symfony_urlA relative or absolute URL for a route, with the arguments of Twig's path and url.
symfony_renderRenders 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.json are the se7enxweb ones, with a replace section so it overrides cleanly.
  • symfony_include asked the container for the removed templating service (gone since Symfony 5), which threw ServiceNotFoundException. It now uses the twig service. A workaround with Twig\Environment::class was tried and reverted once the legacy bridge (v5.0.9) made the twig service public.
  • A class_alias shim loads the API content converter on both the old eZ\Publish\API\Repository\Repository interface and Ibexa DXP 5.0's Ibexa\Contracts\Core\Repository\Repository.

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x