Code snippets for symfony 1.x

Navigation

Set "class" or any attribute of ALL fields in Symfony Form

class ClientForm extends BaseClientForm
{
  public function configure() {
    $fields = $this->getWidgetSchema()->getFields();
    foreach ($fields as $f) {
        $f->setAttribute("class", "client_form_field");
    }
  }
}
 
by gerry eng on 2010-05-09, tagged attribute  form