File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,29 @@ The YAML specification defines some tags to set the type of any data explicitly:
315315 Pz7Y6OjuDg4J+fn5OTk6enp
316316 56enmleECcgggoBADs=
317317
318+ Symfony Specific Features
319+ ~~~~~~~~~~~~~~~~~~~~~~~~~
320+
321+ The Yaml component provides some additional features that are not part of the
322+ official YAML specification but are useful in Symfony applications:
323+
324+ * ``!php/const `` allows to get the value of a PHP constant. This tag takes the
325+ fully-qualified class name of the constant as its argument:
326+
327+ .. code-block :: yaml
328+
329+ data :
330+ page_limit : !php/const App\Pagination\Paginator::PAGE_LIMIT
331+
332+ * ``!php/object `` allows to pass the serialized representation of a PHP
333+ object (created with the `serialize() `_ function), which will be deserialized
334+ when parsing the YAML file:
335+
336+ .. code-block :: yaml
337+
338+ data :
339+ my_object : !php/object 'O:8:"stdClass":1:{s:3:"bar";i:2;}'
340+
318341 Unsupported YAML Features
319342~~~~~~~~~~~~~~~~~~~~~~~~~
320343
@@ -332,3 +355,4 @@ The following YAML features are not supported by the Symfony Yaml component:
332355
333356.. _`YAML 1.2 version specification` : https://yaml.org/spec/1.2/spec.html
334357.. _`ISO-8601` : https://www.iso.org/iso-8601-date-and-time-format.html
358+ .. _`serialize()` : https://www.php.net/manual/en/function.serialize.php
You can’t perform that action at this time.
0 commit comments