It is by design, the $decoratorFormat is only used when you embed a form

On Wed, Oct 14, 2009 at 1:13 PM, Iwan van Staveren <istave...@gmail.com>wrote:

>
> When I would like to render a form with
> sfWidgetFormSchemaFormatterTable as decorator. But to let it work I
> need to type the following code:
>
> </table>
>      <?php echo $form ?>
> </table>
>
> Although the form decorator table has a format
>
>    $decoratorFormat = "<table>\n  %content%</table>";
>
> I would prefer that I could render the form like
>
>     <?php echo $form ?>
>
> So that when I change my decorator to for example list I don't need to
> change the template.
>
>
> I made a patch to fix this:
>
> Index: lib/vendor/symfony/lib/form/sfForm.class.php
> ===================================================================
> --- lib/vendor/symfony/lib/form/sfForm.class.php        (revision 23006)
> +++ lib/vendor/symfony/lib/form/sfForm.class.php        (working copy)
> @@ -118,7 +118,8 @@
>    */
>   public function render($attributes = array())
>   {
> -    return $this->getFormFieldSchema()->render($attributes);
> +    return strtr($this->getWidgetSchema()->getFormFormatter()-
> >getDecoratorFormat(),
> +                 array('%content%' => $this->getFormFieldSchema()-
> >render($attributes)));
>   }
>
>   /**
>
>
> Is this by design or a bug in symfony or do I forgot something?
>
>
> >
>


-- 
Thomas Rabaix
http://rabaix.net

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to