3 namespace Rapsys\AirBundle\Form
;
5 use Symfony\Component\Form\Extension\Core\Type\TelType
;
6 use Symfony\Component\Form\Extension\Core\Type\UrlType
;
7 use Symfony\Component\Form\FormBuilderInterface
;
8 use Symfony\Component\OptionsResolver\OptionsResolver
;
9 use Symfony\Component\Validator\Constraints\NotBlank
;
11 class RegisterType
extends \Rapsys\UserBundle\Form\RegisterType
{
15 public function buildForm(FormBuilderInterface
$builder, array $options) {
16 //Call parent build form
17 $form = parent
::buildForm($builder, $options);
19 //Add extra phone field
20 if (!empty($options['phone'])) {
21 $form->add('phone', TelType
::class, ['attr' => ['placeholder' => 'Your phone'], 'required' => false]);
31 public function configureOptions(OptionsResolver
$resolver) {
32 //Call parent configure options
33 parent
::configureOptions($resolver);
36 $resolver->setDefaults(['phone' => true]);
38 //Add extra mail option
39 $resolver->setAllowedTypes('phone', 'boolean');
46 public function getName() {
47 return 'rapsys_air_register';