Skip to content
Browse files

Fix inheritance of FormExtension

  • Loading branch information...
1 parent eadb771 commit 32b697e9494bdab362b48c72315e95194283b889 @Strate Strate committed Nov 24, 2012
Showing with 17 additions and 3 deletions.
  1. +17 −3 Twig/Extension/FormExtension.php
View
20 Twig/Extension/FormExtension.php
@@ -11,17 +11,30 @@
namespace Genemu\Bundle\FormBundle\Twig\Extension;
-use Symfony\Bridge\Twig\Extension\FormExtension as BaseFormExtension;
use Symfony\Component\Form\FormView;
+use Symfony\Bridge\Twig\Form\TwigRendererInterface;
/**
* FormExtension extends Twig with form capabilities.
*
* @author Olivier Chauvel <olivier@generation-multiple.com>
*/
-class FormExtension extends BaseFormExtension
+class FormExtension extends \Twig_Extension
{
/**
+ * This property is public so that it can be accessed directly from compiled
+ * templates without having to call a getter, which slightly decreases performance.
+ *
+ * @var \Symfony\Component\Form\FormRendererInterface
+ */
+ public $renderer;
+
+ public function __construct(TwigRendererInterface $renderer)
+ {
+ $this->renderer = $renderer;
+ }
+
+ /**
* {@inheritdoc}
*/
public function getFunctions()
@@ -35,7 +48,8 @@ public function getFunctions()
/**
* Render Function Form Javascript
*
- * @param FromView $view
+ * @param FormView $view
+ * @param bool $prototype
*
* @return string
*/

0 comments on commit 32b697e

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