<?php
/**
* Created by PhpStorm.
* User: parcel
* Date: 8/24/18
* Time: 8:49 PM
*/
namespace App\Form;
use App\Entity\Parcel;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ParcelForm extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder
->add('description', TextareaType::class);
}
public function configureOptions(OptionsResolver $resolver) {
$resolver
->setDefaults([
'data_class' =>Parcel::class
]);
}
public function getBlockPrefix()
{
return 'app_bundle_parcel_form';
}
}