Edit regex to allow space in phone numbers

Allowing to set multiple phone in one case, separed by space, but still digits only
This commit is contained in:
Xbird
2022-08-13 22:59:48 +02:00
parent b53ae1f424
commit 331ee16a71

View File

@@ -13,7 +13,7 @@ class PhoneType extends AbstractType
{
$resolver->setDefaults([
'constraints' => [
new Regex('/^[0-9]*$/', 'form_constraint_digit_only')
new Regex('/^[0-9 ]*$/', 'form_constraint_digit_only')
],
'attr' => ['placeholder' => 'form_placeholder_phone'],
'help' => 'form_help_phone',