Fixing 'required' property for form fields.

This commit is contained in:
Alexey Skobkin 2020-01-20 20:12:52 +03:00
parent 2c0c48d88e
commit b2695ade8e
No known key found for this signature in database
GPG key ID: 5D5CEF6F221278E7
3 changed files with 7 additions and 7 deletions

View file

@ -11,8 +11,8 @@ class LoginType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('_username', TextType::class, ['mapped' => false])
->add('_password', PasswordType::class, ['mapped' => false])
->add('_username', TextType::class, ['mapped' => false, 'required' => true])
->add('_password', PasswordType::class, ['mapped' => false, 'required' => true])
;
}

View file

@ -10,7 +10,7 @@ class PasswordResetRequestType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('email', EmailType::class);
$builder->add('email', EmailType::class, ['required' => true]);
}
public function configureOptions(OptionsResolver $resolver)

View file

@ -13,10 +13,10 @@ class RegisterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', TextType::class)
->add('password', PasswordType::class)
->add('email', EmailType::class)
->add('inviteCode', TextType::class)
->add('username', TextType::class, ['required' => true])
->add('password', PasswordType::class, ['required' => true])
->add('email', EmailType::class, ['required' => true])
->add('inviteCode', TextType::class, ['required' => true])
;
}