File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,10 @@ These are the options available on the :ref:`serializer context <serializer-cont
205205``cdata_wrapping_pattern `` (default: ``/[<>&]/ ``)
206206 A regular expression pattern to determine if a value should be wrapped
207207 in a CDATA section.
208+ ``cdata_wrapping_name_pattern `` (default: ``false ``)
209+ A regular expression pattern that defines the names of fields whose values
210+ should always be wrapped in a CDATA section, even if their contents don't
211+ require it. Example: ``'/(firstname|lastname)/' ``
208212``ignore_empty_attributes `` (default: ``false ``)
209213 If set to true, ignores all attributes with empty values in the generated XML
210214
@@ -216,6 +220,10 @@ These are the options available on the :ref:`serializer context <serializer-cont
216220
217221 The ``ignore_empty_attributes `` option was introduced in Symfony 7.3.
218222
223+ .. versionadded :: 7.4
224+
225+ The ``cdata_wrapping_name_pattern `` option was introduced in Symfony 7.4.
226+
219227Example with a custom ``context ``::
220228
221229 use Symfony\Component\Serializer\Encoder\XmlEncoder;
You can’t perform that action at this time.
0 commit comments