소스 검색

added the possibility to easily customize the template of just one widget of a form (PHP edition)

Fabien Potencier 14 년 전
부모
커밋
3a36c08d8e
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php

+ 3 - 1
src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php

@@ -101,7 +101,9 @@ class FormHelper extends Helper
     {
         $template = null;
         $blocks = $view->get('types');
-
+        if ('widget' === $section || 'row' === $section) {
+            array_unshift($blocks, '_'.$view->get('id'));
+        }
         foreach ($blocks as &$block) {
             $block = $block.'_'.$section;
             $template = $this->lookupTemplate($block);