<?php
/**
* Created by PhpStorm.
* User: Mauricio
* Date: 20/05/2019
* Time: 4:33 PM
*/
namespace App\Form;
use App\Entity\Blog;
use App\Entity\Comentario;
use App\Entity\ComentarioBlog;
use App\Entity\Usuario;
use Doctrine\ORM\EntityRepository;
use Gregwar\CaptchaBundle\Type\CaptchaType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ComentarioType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('comentario')
->add('usuario', EntityType::class,array(
'class' => Usuario::class
))
->add('blog', EntityType::class,array(
'class' => Blog::class
));
//$builder->add('captcha', CaptchaType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => ComentarioBlog::class
]);
}
}