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.
219
219
Constants as Parameters
220
220
-----------------------
221
221
222
- The XML and PHP formats also have support for setting PHP constants as parameters.
222
+ Setting PHP constants as parameters is also supported .
223
223
To take advantage of this feature, map the name of your constant to a parameter
224
224
key and define the type as ``constant ``.
225
225
226
226
.. configuration-block ::
227
227
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
+
228
234
.. code-block :: xml
229
235
230
236
<?xml version =" 1.0" encoding =" UTF-8" ?>
@@ -243,15 +249,6 @@ key and define the type as ``constant``.
243
249
$container->setParameter('global.constant.value', GLOBAL_CONSTANT);
244
250
$container->setParameter('my_class.constant.value', My_Class::CONSTANT_NAME);
245
251
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 }
255
252
256
253
PHP Keywords in XML
257
254
-------------------
You can’t perform that action at this time.
0 commit comments