浏览代码

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);