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

Commit41d43dd

Browse files
committed
feature#5483 [FrameworkBundle] Name converter of Serializer (dunglas)
This PR was squashed before being merged into the 2.8 branch (closes#5483).Discussion----------[FrameworkBundle] Name converter of Serializer| Q | A| ------------- | ---| Doc fix? | no| New docs? | yessymfony/symfony#14987| Applies to | 2.8| Fixed tickets | n/aCommits-------7a4d9fc [FrameworkBundle] Name converter of Serializer
2 parentse821b97 +7a4d9fc commit41d43dd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

‎components/serializer.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ method on the normalizer definition::
344344
$serializer = new Serializer(array($normalizer), array($encoder));
345345
$serializer->serialize($person, 'json'); // Output: {"name":"foo","sportsman":false}
346346

347+
.. _component-serializer-converting-property-names-when-serializing-and-deserializing:
348+
347349
Converting Property Names when Serializing and Deserializing
348350
------------------------------------------------------------
349351

‎reference/configuration/framework.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Configuration
104104
*:ref:`enabled<reference-serializer-enabled>`
105105
*:ref:`cache<reference-serializer-cache>`
106106
*:ref:`enable_annotations<reference-serializer-enable_annotations>`
107+
* `name_converter`_
107108

108109
secret
109110
~~~~~~
@@ -1505,6 +1506,24 @@ If this option is enabled, serialization groups can be defined using annotations
15051506

15061507
For more information, see:ref:`cookbook-serializer-using-serialization-groups-annotations`.
15071508

1509+
name_converter
1510+
..............
1511+
1512+
..versionadded::2.8
1513+
The ``name_converter`` setting was introduced in Symfony 2.8.
1514+
1515+
**type**: ``string``
1516+
1517+
The name converter to use.
1518+
The:class:`Symfony\\Component\\Serializer\\NameConverter\\CamelCaseToSnakeCaseNameConverter`
1519+
name converter can enabled by using the ``serializer.name_converter.camel_case_to_snake_case``
1520+
value.
1521+
1522+
..seealso::
1523+
1524+
For more information, see
1525+
:ref:`component-serializer-converting-property-names-when-serializing-and-deserializing`.
1526+
15081527
Full Default Configuration
15091528
--------------------------
15101529

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp