diff --git a/cookbook/doctrine/registration_form.rst b/cookbook/doctrine/registration_form.rst index 072f32cbaf1..090b8c8c251 100644 --- a/cookbook/doctrine/registration_form.rst +++ b/cookbook/doctrine/registration_form.rst @@ -35,7 +35,7 @@ Your ``User`` entity will probably at least have the following fields: ``plainPassword`` This field is *not* persisted: (notice no ``@ORM\Column`` above it). It temporarily stores the plain password from the registration form. This field - can be validated then used to populate the ``password`` field. + can be validated and is then used to populate the ``password`` field. With some validation added, your class may look something like this:: @@ -127,7 +127,7 @@ With some validation added, your class may look something like this:: public function getSalt() { - // The bcrypt algorithm don't require a separate salt. + // The bcrypt algorithm doesn't require a separate salt. // You *may* need a real salt if you choose a different encoder. return null; } @@ -135,9 +135,10 @@ With some validation added, your class may look something like this:: // other methods, including security methods like getRoles() } -The ``UserInterface`` requires a few other methods and your ``security.yml`` file -needs to be configured properly to work with the ``User`` entity. For a more full -example, see the :ref:`Entity Provider ` article. +The :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface` requires +a few other methods and your ``security.yml`` file needs to be configured +properly to work with the ``User`` entity. For a more complete example, see +the :ref:`Entity Provider ` article. .. _cookbook-registration-password-max: @@ -186,7 +187,7 @@ Next, create the form for the ``User`` entity:: public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( - 'data_class' => 'AppBundle\Entity\User' + 'data_class' => 'AppBundle\Entity\User', )); } @@ -201,7 +202,8 @@ There are just three fields: ``email``, ``username`` and ``plainPassword`` .. tip:: - To explore more things about the Form component, read :doc:`/book/forms`. + To explore more things about the Form component, read the + :doc:`chapter about forms ` in the book. Handling the Form Submission ---------------------------- @@ -213,10 +215,9 @@ into the database:: // src/AppBundle/Controller/RegistrationController.php namespace AppBundle\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; - use AppBundle\Form\UserType; use AppBundle\Entity\User; + use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; @@ -376,8 +377,8 @@ See :doc:`/cookbook/form/form_customization` for more details. Update your Database Schema --------------------------- -If you've updated the User entity during this tutorial, you have to update your -database schema using this command: +If you've updated the ``User`` entity during this tutorial, you have to update +your database schema using this command: .. code-block:: bash