63 lines
1.6 KiB
PHP
63 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Deblan\Bundle\ContactBundle\Form\Type;
|
|
|
|
use Symfony\Component\Validator\Constraints;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Trinity\Bundle\ContactBundle\Form\Type\ContactType as BaseContactType;
|
|
|
|
class ContactType extends BaseContactType
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
{
|
|
$builder->add(
|
|
'name',
|
|
'text',
|
|
array(
|
|
'attr' => array('class' => 'form-control'),
|
|
'required' => true,
|
|
'constraints' => array(
|
|
new Constraints\NotBlank(),
|
|
)
|
|
)
|
|
);
|
|
|
|
$builder->add(
|
|
'subject',
|
|
'text',
|
|
array(
|
|
'mapped' => false,
|
|
'attr' => array('class' => 'form-control'),
|
|
'required' => true,
|
|
'constraints' => array(
|
|
new Constraints\NotBlank(),
|
|
)
|
|
)
|
|
);
|
|
|
|
$builder->add(
|
|
'email',
|
|
'email',
|
|
array(
|
|
'attr' => array('class' => 'form-control'),
|
|
'required' => true,
|
|
'constraints' => array(
|
|
new Constraints\NotBlank(),
|
|
)
|
|
)
|
|
);
|
|
|
|
$builder->add(
|
|
'message',
|
|
'textarea',
|
|
array(
|
|
'attr' => array('class' => 'form-control'),
|
|
'required' => true,
|
|
'constraints' => array(
|
|
new Constraints\NotBlank(),
|
|
)
|
|
)
|
|
);
|
|
}
|
|
}
|