Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweaks for the registration form article #5794

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cookbook/doctrine/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Your ``User`` entity will probably at least have the following fields:
A nice piece of information to collect. You can also allow users to
:ref:`login via email <registration-form-via-email>`.

* ``password``
``password``
The encoded password.

* ``plainPassword``
``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.
Expand All @@ -49,7 +49,7 @@ With some validation added, your class may look something like this::
/**
* @ORM\Entity
* @UniqueEntity(fields="email", message="Email already taken")
* @UniqueEntity(fields="username", message="Username already taken")
* @UniqueEntity(fields="username", message="Username already taken")
*/
class User implements UserInterface
{
Expand Down Expand Up @@ -253,7 +253,7 @@ controller for displaying the registration form::

If you decide to NOT use annotation routing (shown above), then you'll
need to create a route to this controller:

.. configuration-block::

.. code-block:: yaml
Expand Down Expand Up @@ -296,7 +296,7 @@ Next, create the template:
.. code-block:: html+jinja

{# app/Resources/views/registration/register.html.twig #}

{{ form_start(form) }}
{{ form_row('form.username') }}
{{ form_row('form.email') }}
Expand All @@ -305,7 +305,7 @@ Next, create the template:

<button type="submit">Register!</button>
{{ form_end(form) }}

.. code-block:: html+php

<!-- app/Resources/views/registration/register.html.php -->
Expand Down Expand Up @@ -370,8 +370,8 @@ registration form. The only trick is that you want to add this field to your for
without adding an unnecessary new ``termsAccepted`` property to your ``User`` entity
that you'll never need.

To do this, add a ``termsAccepted`` field to your form, but set its :ref:`mapped <reference-form-option-mapped>`
option to ``false``::
To do this, add a ``termsAccepted`` field to your form, but set its
:ref:`mapped <reference-form-option-mapped>` option to ``false``::

// src/AppBundle/Form/UserType.php
// ...
Expand Down