3

I have noticed in several bundles that some services definition files had parameters embedded in it, like in the following example:

<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <!-- CUSTOMER -->
        <parameter key="sonata.customer.admin.customer.class">Sonata\CustomerBundle\Admin\CustomerAdmin</parameter>
        <parameter key="sonata.customer.admin.customer.controller">SonataAdminBundle:CRUD</parameter>
    </parameters>

    <services>
        <service id="sonata.customer.admin.customer" class="%sonata.customer.admin.customer.class%">
            <tag name="sonata.admin" manager_type="orm" group="sonata_ecommerce" label="B2C" label_translator_strategy="sonata.admin.label.strategy.underscore"/>
            <argument />
            <argument>%sonata.customer.admin.customer.entity%</argument>
            <argument>%sonata.customer.admin.customer.controller%</argument>

            <call method="addChild">
                <argument type="service" id="sonata.customer.admin.address" />
            </call>

            <call method="addChild">
                <argument type="service" id="sonata.order.admin.order" />
            </call>
        </service>

    </services>

</container>

Those parameters are not exposed as bundle configuration.

I recently discovered it is possible to add a CompilerPass class to override some service definitions. Although, this looks a bit tedious to do.

Is it possible to override those <parameter> by configuration ?

1 Answer 1

5

In your app/config/config.yml (or whatever imported config file) add :

parameters:
    parameter.name: new_value
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.