Ver código fonte

added initiating template in renderWidget

IamPersistent 14 anos atrás
pai
commit
ac8e35549e

+ 4 - 0
src/Symfony/Bundle/TwigBundle/Extension/FormExtension.php

@@ -154,6 +154,10 @@ class FormExtension extends \Twig_Extension
 
 
     public function renderWidget(FieldInterface $field, array $attributes = array(), $resources = null)
     public function renderWidget(FieldInterface $field, array $attributes = array(), $resources = null)
     {
     {
+        if (null === $this->templates) {
+            $this->templates = $this->resolveResources($this->resources);
+        }
+
         if (null === $resources) {
         if (null === $resources) {
             $parent = $field;
             $parent = $field;
             $resources = array();
             $resources = array();