소스 검색

added the possibility to easily customize the template of just one widget of a form

Fabien Potencier 14 년 전
부모
커밋
a204aec08b
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/Symfony/Bridge/Twig/Extension/FormExtension.php

+ 3 - 0
src/Symfony/Bridge/Twig/Extension/FormExtension.php

@@ -156,6 +156,9 @@ class FormExtension extends \Twig_Extension
     {
         $templates = $this->getTemplates($view);
         $blocks = $view->get('types');
+        if ('widget' === $section || 'row' === $section) {
+            array_unshift($blocks, '_'.$view->get('id'));
+        }
         foreach ($blocks as &$block) {
             $block = $block.'_'.$section;