@@ -178,6 +178,9 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
178178 use Symfony\Bridge\Twig\Extension\FormExtension;
179179 use Symfony\Component\Form\FormRenderer;
180180 use Symfony\Bridge\Twig\Form\TwigRendererEngine;
181+ use Twig\Environment;
182+ use Twig\Loader\FilesystemLoader;
183+ use Twig\RuntimeLoader\FactoryRuntimeLoader;
181184
182185 // the Twig file that holds all the default markup for rendering forms
183186 // this file comes with TwigBridge
@@ -191,12 +194,12 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
191194 // the path to your other templates
192195 $viewsDirectory = realpath(__DIR__.'/../views');
193196
194- $twig = new Twig_Environment (new Twig_Loader_Filesystem (array(
197+ $twig = new Environment (new FilesystemLoader (array(
195198 $viewsDirectory,
196199 $vendorTwigBridgeDirectory.'/Resources/views/Form',
197200 )));
198201 $formEngine = new TwigRendererEngine(array($defaultFormTheme), $twig);
199- $twig->addRuntimeLoader(new \Twig_FactoryRuntimeLoader (array(
202+ $twig->addRuntimeLoader(new FactoryRuntimeLoader (array(
200203 FormRenderer::class => function () use ($formEngine, $csrfManager) {
201204 return new FormRenderer($formEngine, $csrfManager);
202205 },
@@ -213,7 +216,7 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
213216 ->getFormFactory();
214217
215218.. versionadded :: 1.30
216- The ``Twig_FactoryRuntimeLoader `` was introduced in Twig 1.30.
219+ The ``Twig\\RuntimeLoader\\FactoryRuntimeLoader `` was introduced in Twig 1.30.
217220
218221The exact details of your `Twig Configuration `_ will vary, but the goal is
219222always to add the :class: `Symfony\\ Bridge\\ Twig\\ Extension\\ FormExtension `
@@ -253,7 +256,7 @@ installed:
253256 $ composer require symfony/translation symfony/config
254257
255258 Next, add the :class: `Symfony\\ Bridge\\ Twig\\ Extension\\ TranslationExtension `
256- to your ``Twig_Environment `` instance::
259+ to your ``Twig\\Environment `` instance::
257260
258261 use Symfony\Component\Form\Forms;
259262 use Symfony\Component\Translation\Translator;
0 commit comments