Browse Source

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

Fabien Potencier 14 years ago
parent
commit
3a36c08d8e

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