Pass object fields to RepeatedType form field

108 views Asked by At

I have class with user data and i would like to validate it by form.

I have issue with password field.

Field with password in form:

add('password', RepeatedType::class, [
                'first_options'  => ['label' => 'password'],
                'second_options' => ['label' => 'Repeat password'],
                'invalid_message' => 'The password fields must match.'
            ])

In model I have two fields:

    public string $password;
    public string $passwordRepeat;

How to bind model fileds to form field?

0

There are 0 answers