@@ -28,10 +28,10 @@ Your ``User`` entity will probably at least have the following fields:
28
28
A nice piece of information to collect. You can also allow users to
29
29
:ref: `login via email <registration-form-via-email >`.
30
30
31
- * ``password ``
31
+ ``password ``
32
32
The encoded password.
33
33
34
- * ``plainPassword ``
34
+ ``plainPassword ``
35
35
This field is *not * persisted: (notice no ``@ORM\Column `` above it). It
36
36
temporarily stores the plain password from the registration form. This field
37
37
can be validated then used to populate the ``password `` field.
@@ -49,7 +49,7 @@ With some validation added, your class may look something like this::
49
49
/**
50
50
* @ORM\Entity
51
51
* @UniqueEntity(fields="email", message="Email already taken")
52
- * @UniqueEntity(fields="username", message="Username already taken")
52
+ * @UniqueEntity(fields="username", message="Username already taken")
53
53
*/
54
54
class User implements UserInterface
55
55
{
@@ -163,8 +163,8 @@ Next, create the form for the ``User`` entity::
163
163
public function buildForm(FormBuilderInterface $builder, array $options)
164
164
{
165
165
$builder
166
- ->add('email', 'email');
167
- ->add('username', 'text');
166
+ ->add('email', 'email')
167
+ ->add('username', 'text')
168
168
->add('plainPassword', 'repeated', array(
169
169
'type' => 'password',
170
170
'first_options' => array('label' => 'Password'),
@@ -245,7 +245,7 @@ controller for displaying the registration form::
245
245
246
246
If you decide to NOT use annotation routing (shown above), then you'll
247
247
need to create a route to this controller:
248
-
248
+
249
249
.. configuration-block ::
250
250
251
251
.. code-block :: yaml
@@ -288,7 +288,7 @@ Next, create the template:
288
288
.. code-block :: html+jinja
289
289
290
290
{# app/Resources/views/registration/register.html.twig #}
291
-
291
+
292
292
{{ form_start(form) }}
293
293
{{ form_row('form.username') }}
294
294
{{ form_row('form.email') }}
@@ -297,7 +297,7 @@ Next, create the template:
297
297
298
298
<button type="submit">Register!</button>
299
299
{{ form_end(form) }}
300
-
300
+
301
301
.. code-block :: html+php
302
302
303
303
<!-- app/Resources/views/registration/register.html.php -->
@@ -362,12 +362,12 @@ registration form. The only trick is that you want to add this field to your for
362
362
without adding an unnecessary new ``termsAccepted `` property to your ``User `` entity
363
363
that you'll never need.
364
364
365
- To do this, add a ``termsAccepted `` field to your form, but set its :ref: ` mapped < reference-form-option-mapped >`
366
- option to ``false ``::
365
+ To do this, add a ``termsAccepted `` field to your form, but set its
366
+ :ref: ` mapped < reference-form-option-mapped >` option to ``false ``::
367
367
368
368
// src/AppBundle/Form/UserType.php
369
369
// ...
370
- use Symfony\\ Component\\ Validator\\ Constraints\ \IsTrue;
370
+ use Symfony\Component\Validator\Constraints\IsTrue;
371
371
372
372
class UserType extends AbstractType
373
373
{
0 commit comments