I work with Symfony2 and I would like to create a registration form. I don't want to use FOSUserBundle.
So, I create an Entity Account (with fields : username, password, email...) and I create the form :
$account = new Account();
$form = $this->createFormBuilder($account)
->add('username', 'text', array('label' => 'Nom de compte :'))
->add('password', 'password', array('label' => 'Mot de passe :'))
->add('email', 'email', array('label' => 'Adresse email :'))
->getForm();
Now, I want to add a confirmation field for the password. But, when I try to add a field with add() method, for example "password_confirmation" I have this :
Neither property "password_confirmation" nor method "getPasswordConfirmation()" nor method "isPasswordConfirmation()" exists in class "App\FrontBundle\Entity\Account"
How can I add a custom field ? And after, how to valid it ?
Thank you. BR.