소스 검색

added initiating template in renderWidget

IamPersistent 14 년 전
부모
커밋
ac8e35549e
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/Symfony/Bundle/TwigBundle/Extension/FormExtension.php

+ 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)
     {
+        if (null === $this->templates) {
+            $this->templates = $this->resolveResources($this->resources);
+        }
+
         if (null === $resources) {
             $parent = $field;
             $resources = array();