src/Form/ComentarioType.php line 25

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: Mauricio
  5.  * Date: 20/05/2019
  6.  * Time: 4:33 PM
  7.  */
  8. namespace App\Form;
  9. use App\Entity\Blog;
  10. use App\Entity\Comentario;
  11. use App\Entity\ComentarioBlog;
  12. use App\Entity\Usuario;
  13. use Doctrine\ORM\EntityRepository;
  14. use Gregwar\CaptchaBundle\Type\CaptchaType;
  15. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  16. use Symfony\Component\Form\AbstractType;
  17. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  18. use Symfony\Component\Form\Extension\Core\Type\TextType;
  19. use Symfony\Component\Form\FormBuilderInterface;
  20. use Symfony\Component\OptionsResolver\OptionsResolver;
  21. class ComentarioType extends AbstractType
  22. {
  23.     public function buildForm(FormBuilderInterface $builder, array $options)
  24.     {
  25.         $builder
  26.             ->add('comentario')
  27.             ->add('usuario'EntityType::class,array(
  28.                 'class' => Usuario::class
  29.             ))
  30.             ->add('blog',  EntityType::class,array(
  31.                 'class' => Blog::class
  32.             ));
  33.         //$builder->add('captcha', CaptchaType::class);
  34.     }
  35.     public function configureOptions(OptionsResolver $resolver)
  36.     {
  37.         $resolver->setDefaults([
  38.             'data_class' => ComentarioBlog::class
  39.         ]);
  40.     }
  41. }