Skip to content
This repository
Browse code

Fix inheritance of FormExtension

  • Loading branch information...
commit 32b697e9494bdab362b48c72315e95194283b889 1 parent eadb771
Artur Eshenbrener Strate authored

Showing 1 changed file with 17 additions and 3 deletions. Show diff stats Hide diff stats

  1. +17 3 Twig/Extension/FormExtension.php
20 Twig/Extension/FormExtension.php
@@ -11,17 +11,30 @@
11 11
12 12 namespace Genemu\Bundle\FormBundle\Twig\Extension;
13 13
14   -use Symfony\Bridge\Twig\Extension\FormExtension as BaseFormExtension;
15 14 use Symfony\Component\Form\FormView;
  15 +use Symfony\Bridge\Twig\Form\TwigRendererInterface;
16 16
17 17 /**
18 18 * FormExtension extends Twig with form capabilities.
19 19 *
20 20 * @author Olivier Chauvel <olivier@generation-multiple.com>
21 21 */
22   -class FormExtension extends BaseFormExtension
  22 +class FormExtension extends \Twig_Extension
23 23 {
24 24 /**
  25 + * This property is public so that it can be accessed directly from compiled
  26 + * templates without having to call a getter, which slightly decreases performance.
  27 + *
  28 + * @var \Symfony\Component\Form\FormRendererInterface
  29 + */
  30 + public $renderer;
  31 +
  32 + public function __construct(TwigRendererInterface $renderer)
  33 + {
  34 + $this->renderer = $renderer;
  35 + }
  36 +
  37 + /**
25 38 * {@inheritdoc}
26 39 */
27 40 public function getFunctions()
@@ -35,7 +48,8 @@ public function getFunctions()
35 48 /**
36 49 * Render Function Form Javascript
37 50 *
38   - * @param FromView $view
  51 + * @param FormView $view
  52 + * @param bool $prototype
39 53 *
40 54 * @return string
41 55 */

0 comments on commit 32b697e

Please sign in to comment.
Something went wrong with that request. Please try again.