By reading the discussion, I didn't noticed any DRY solution...

this one could help you, even if it's -maybe- not the fastest, but the
DRY'est :

//for sf 1.3
in lib/form/BaseForm.class.php

{{{

  public function setup() {

    parent::setup();

    foreach($this->getValidatorSchema()->getFields() as $name =>
$validator) {
      $validator->setOption('trim', true);
    }
  }

}}}


That's the way I do when I want to configure something for ALL the
forms of my project.

But you can be more granular by testing the value of get_class($this)
or the name of the validator/widget.

Hope it helps !

On 2 fév, 22:28, "rooster (Russ)" <russmon...@gmail.com> wrote:
> Some discussion about this here:
>
> http://forum.symfony-project.org/index.php/m/56343/#msg_56343
>
> On Feb 2, 8:11 pm, DoRiaN <doria...@gmail.com> wrote:
>
> > Up please :)
>
> > On 1 fév, 17:44, DoRiaN <doria...@gmail.com> wrote:
>
> > > Hello (i'm french, excuse me for my english),
>
> > > How to set trim default option on all widgets in a Form ?
>
> > > Thanks,
> > > Dorian- Hide quoted text -
>
> > - Show quoted text -
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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