Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitabb2003

Browse files
committed
[Form] Document thehash_mapping option
1 parentc5ef631 commitabb2003

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎reference/forms/types/password.rst‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ with the ``value`` attribute set to its true value only upon submission.
3535
If you want to render your password field *with* the password value already
3636
entered into the box, set this to false and submit the form.
3737

38+
``hash_mapping``
39+
~~~~~~~~~~~~~~~~
40+
41+
**type**: ``string`` **default**: ``null``
42+
43+
If set, the password will be hashed using the PasswordHasher component and
44+
stored in the specified property.
45+
46+
Data passed to the form must be a ``PasswordAuthenticatedUserInterface`` object.
47+
48+
..caution::
49+
50+
To minimize the risk of leaking the plain password,
51+
this option can only be used with the ``mapped`` option set to ``false``.
52+
53+
$builder->add('plainPassword', PasswordType::class, [
54+
'hash_mapping' => 'password',
55+
'mapped' => false,
56+
]);
57+
58+
See the:ref:`"mapped" option documentation<reference-form-mapped>`.
59+
3860
Overridden Options
3961
------------------
4062

@@ -81,6 +103,8 @@ The default value is ``''`` (the empty string).
81103

82104
..include::/reference/forms/types/options/label_format.rst.inc
83105

106+
.. _reference-form-mapped:
107+
84108
..include::/reference/forms/types/options/mapped.rst.inc
85109

86110
..include::/reference/forms/types/options/required.rst.inc

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp