Skip to content

Commit 3280644

Browse files
authored
document serializer default_context
1 parent d3cb494 commit 3280644

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

reference/configuration/framework.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,6 +2836,22 @@ paths
28362836
This option allows to define an array of paths with files or directories where
28372837
the component will look for additional serialization files.
28382838

2839+
default_context
2840+
...............
2841+
2842+
**type**: ``array`` **default**: ``[]``
2843+
2844+
A map with default context options that will be used with each ``serialize`` and ``deserialize``
2845+
call. This can be used for example to set the json encoding behavior by setting ``json_encode_options``
2846+
to a `json_encode flags bitmask`_.
2847+
2848+
You can inspect the :ref:`serializer context builders <serializer-using-context-builders>`
2849+
to discover the available settings.
2850+
2851+
.. versionadded:: 5.4
2852+
2853+
The ``default_context`` parameter was introduced in Symfony 5.4.
2854+
28392855
php_errors
28402856
~~~~~~~~~~
28412857

@@ -3612,6 +3628,7 @@ use the configuration of the first exception that matches ``instanceof``:
36123628
.. _`blue/green deployment`: https://martinfowler.com/bliki/BlueGreenDeployment.html
36133629
.. _`gulp-rev`: https://www.npmjs.com/package/gulp-rev
36143630
.. _`webpack-manifest-plugin`: https://www.npmjs.com/package/webpack-manifest-plugin
3631+
.. _`json_encode flags bitmask`: https://www.php.net/json_encode
36153632
.. _`error_reporting PHP option`: https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
36163633
.. _`CSRF security attacks`: https://en.wikipedia.org/wiki/Cross-site_request_forgery
36173634
.. _`session.sid_length PHP option`: https://www.php.net/manual/session.configuration.php#ini.session.sid-length

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy