1

I have tried to change the attr "id" in a FormType.php file :

->add('content', TextareaType::class,([
    'label' => "Description détaillée",
    'attr' => [
        'placeholder' => "Donnez une description qui donne vraiment envoe de venir chez vous !",
        'id' => "test_id"
     ]
]))

NB : I WANT TO CHANGE ONLY THE "ID"

Thank you

giovybus
  • 349
  • 1
  • 3
  • 10
technico
  • 113
  • 8

1 Answers1

0

you can't add the id in controller, but you can add it in the view, like this:

{{ form_row(form.content, { 'id': 'test_id' }) }}
giovybus
  • 349
  • 1
  • 3
  • 10