use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
*/
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')))));
+ ->add('phone', TelType::class, ['attr' => ['placeholder' => 'Your phone'], 'required' => false]);