File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -219,12 +219,18 @@ for all parameters that are arrays.
219219Constants as Parameters
220220-----------------------
221221
222- The XML and PHP formats also have support for setting PHP constants as parameters.
222+ Setting PHP constants as parameters is also supported .
223223To take advantage of this feature, map the name of your constant to a parameter
224224key and define the type as ``constant ``.
225225
226226.. configuration-block ::
227227
228+ .. code-block :: yaml
229+
230+ parameters :
231+ global.constant.value : !php/const:GLOBAL_CONSTANT
232+ my_class.constant.value : !php/const:My_Class::CONSTANT_NAME
233+
228234 .. code-block :: xml
229235
230236 <?xml version =" 1.0" encoding =" UTF-8" ?>
@@ -243,15 +249,6 @@ key and define the type as ``constant``.
243249 $container->setParameter('global.constant.value', GLOBAL_CONSTANT);
244250 $container->setParameter('my_class.constant.value', My_Class::CONSTANT_NAME);
245251
246- .. tip ::
247-
248- If you're using YAML, you can :doc: `import an XML file </service_container/import >`
249- to take advantage of this functionality:
250-
251- .. code-block :: yaml
252-
253- imports :
254- - { resource: parameters.xml }
255252
256253 PHP Keywords in XML
257254-------------------
You can’t perform that action at this time.
0 commit comments