I want to add a stylesheet class attribute to most of the fields, but not all.
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('name_short', null, ['attr' => ['class' => 'rtl']] )
->add('name_long')
->add('profile_education')
->add('profile_work')
->add('profile_political')
->add('twitter')
->add('facebook')
->add('website')
;
}
Is there a simpler way than adding the attribute ['attr' => ['class' => 'rtl']] to every field? Looking for something like looping the fields and setting the attribute after adding the field to the builder.
Thanks for any pointers.