How to add placeholder on input in Symfony 4 form?
问题 In my Symfony 4 form, I am try to get a placeholder for my input. I tried the below but I get an error that it is not allowed. Any ideas how else I can achieve this? ->add('firstname', TextType::class, ['label' => 'Vorname ', 'placeholder' => 'Your name',]) As suggested in the documentation I have also tried the below, here I am not getting an error, just nothing is rendering. ->add('firstname', TextType::class, ['label' => 'Vorname '], ['attr' => ['placeholder' => 'Vorname ']]) 回答1: You need