<?php
namespace App\Form;
use App\Entity\Tickets;
use App\Entity\Users;
use App\Entity\Categories;
use App\Entity\Status;
use App\Entity\Priorities;
use App\Entity\Accounts;
use App\Entity\Departments;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Validator\Constraints\IsTrue;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Contracts\Translation\TranslatorInterface;
class TicketPortalFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('subject', TextType::class, [
'attr' => [
'class' => 'form-control',
'placeholder' => 'Subject'
],
'label' => false,
])
->add('description', TextareaType::class, [
'attr' => [
'class' => 'form-control',
'placeholder' => 'Description'
],
'label' => false,
])
->add('notes', TextareaType::class, [
'attr' => [
'class' => 'form-control',
'placeholder' => 'Notes'
],
'label' => false,
])
->add('agreeTerms', CheckboxType::class, [
'mapped' => false,
'label' => 'Agree with terms ',
'constraints' => [
new IsTrue([
'message' => 'You should agree to our terms.',
]),
],
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Tickets::class,
]);
}
}