Commit 8de3aca7 authored by Igor Wiedler's avatar Igor Wiedler

load default form_div_layout.html.twig when using form and twig service providers

This means you no longer have to copy form_div_layout.html.twig to your project
parent 366bf651
...@@ -52,6 +52,11 @@ class TwigServiceProvider implements ServiceProviderInterface ...@@ -52,6 +52,11 @@ class TwigServiceProvider implements ServiceProviderInterface
if (isset($app['form.factory'])) { if (isset($app['form.factory'])) {
$twig->addExtension(new TwigFormExtension(array('form_div_layout.html.twig'))); $twig->addExtension(new TwigFormExtension(array('form_div_layout.html.twig')));
// add loader for form_div_layout.html.twig
$reflected = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension');
$path = dirname($reflected->getFileName()).'/../Resources/views/Form';
$app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($path));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment