]> Raphaël G. Git Repositories - airbundle/commitdiff
Add donation and site url
authorRaphaël Gertz <git@rapsys.eu>
Mon, 28 Dec 2020 07:37:52 +0000 (08:37 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Mon, 28 Dec 2020 07:37:52 +0000 (08:37 +0100)
Form/RegisterType.php

index f7cda544987676134eb271abcd3476c795a2ecf2..83c80b59daafc98062cdcfe1ee7dc88b022f86fa 100644 (file)
@@ -3,6 +3,7 @@
 namespace Rapsys\AirBundle\Form;
 
 use Symfony\Component\Form\Extension\Core\Type\TelType;
 namespace Rapsys\AirBundle\Form;
 
 use Symfony\Component\Form\Extension\Core\Type\TelType;
+use Symfony\Component\Form\Extension\Core\Type\UrlType;
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\Validator\Constraints\NotBlank;
 
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\Validator\Constraints\NotBlank;
 
@@ -12,7 +13,10 @@ class RegisterType extends \Rapsys\UserBundle\Form\RegisterType {
         */
        public function buildForm(FormBuilderInterface $builder, array $options) {
                return parent::buildForm($builder, $options)
         */
        public function buildForm(FormBuilderInterface $builder, array $options) {
                return parent::buildForm($builder, $options)
-                       ->add('phone', TelType::class, array('attr' => array('placeholder' => 'Your phone'), 'constraints' => array(new NotBlank(array('message' => 'Please provide your phone')))));
+                       #TODO: add url ? add text ?
+                       ->add('phone', TelType::class, ['attr' => ['placeholder' => 'Your phone'], 'constraints' => [new NotBlank(['message' => 'Please provide your phone'])]])
+                       ->add('donation', UrlType::class, ['attr' => ['placeholder' => 'Your donation link']])
+                       ->add('site', UrlType::class, ['attr' => ['placeholder' => 'Your website']]);
        }
 
        /**
        }
 
        /**