Answer the question
In order to leave comments, you need to log in
How to assign style class for each select in symfony formtype?
Goodnight.
Tell me how to connect style classes for each select in the form, the code is below:
public function buildForm(FormBuilderInterface $builder, array $options)
{
builder->add('birthday', BirthdayType::class, array(
'placeholder' => array(
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
),
'label' => 'Дата рождения',
'attr' => array('class' => 'select_style')
))
}
Answer the question
In order to leave comments, you need to log in
Solved the problem, for those who come across,
{{ form_widget(form.birthday.day,{'attr': {'class':'name_class_style'}}) }}
{{ form_widget(form.birthday.month,{'attr': {'class':'name_class_style'}}) }}
{{ form_widget(form.birthday.year,{'attr': {'class':'name_class_style'}}) }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question