Skip to content

Commit 814e5bd

Browse files
committed
[symfony#7946] fix PHP parameter config example
1 parent af141a2 commit 814e5bd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

form/create_custom_field_type.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,11 @@ example, suppose that you're storing the shipping parameters in configuration:
313313
.. code-block:: php
314314
315315
// app/config/config.php
316-
$container->setParameter('shipping_options.standard', 'Standard Shipping');
317-
$container->setParameter('shipping_options.expedited', 'Expedited Shipping');
318-
$container->setParameter('shipping_options.priority', 'Priority Shipping');
316+
$container->setParameter('shipping_options', array(
317+
'standard' => 'Standard Shipping',
318+
'expedited' => 'Expedited Shipping',
319+
'priority' => 'Priority Shipping',
320+
));
319321
320322
To use the parameter, define your custom field type as a service, injecting the
321323
``shipping_options`` parameter value as the first argument to its to-be-created

0 commit comments

Comments
 (0)