I have a FormBuilder
Symfony3 and I need to add one class
to label
the discount . As you can see, the third parameter of the method add
is a array
´and a key is attr
which has another array with the attributes of the input element, but not the label. How can I add the class to the label
?
$builder
->add('nota', TextareaType::class, array(
'label' => "Notas",
'required' => false
))
->add('descuento', NumberType::class, array(
'required' => false,
'attr' => array(
'class' => "oculto"
)
))
You can look in the documentation for the parameter
label_attr
in symfony docs'label'=>"Notes,array('label_attr' => array('class' => 'class_name'))"