src/Form/CommentType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Comment;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  6. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  7. use Symfony\Component\Form\Extension\Core\Type\TextType;
  8. use Symfony\Component\Form\FormBuilderInterface;
  9. use Symfony\Component\OptionsResolver\OptionsResolver;
  10. class CommentType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options)
  13.     {
  14.         $builder
  15.             // ->add('label',ChoiceType::class,[
  16.             //     'choices'=>Comment::LABEL
  17.             // ])
  18.             ->add('content',TextareaType::class,[
  19.                 'label'=>false
  20.             ])
  21.         ;
  22.     }
  23.     public function configureOptions(OptionsResolver $resolver)
  24.     {
  25.         $resolver->setDefaults([
  26.             'data_class' => Comment::class,
  27.              'translation_domain'=>'forms',
  28.         ]);
  29.     }
  30. }