Home > Back-end >  Explain These Services.xml File Terms In Shopware 6
Explain These Services.xml File Terms In Shopware 6

Time:02-19

What does argument and argument type mean, What does tag and tag name mean, in Shopware 6 plugin services.xml file?

<?xml version="1.0" ?>

<services>
    <service id="Winner\Service\ExampleService" />

    <service id="Winner\Service\ExampleServiceDecorator" decorates="Winner\Service\ExampleService">
        <tag name="kernel.event_listener" event="product.loaded" />
        <argument type="service" id="Winner\Service\ExampleServiceDecorator.inner" />
    </service>
</services>

CodePudding user response:

The services.xml file is the configuration file for the symfony dependency injection container.

By default, Symfony allows autowiring of the config, but the Shopware default is to configure the DI container manually. Please refer to the Symfony docs for more information on manually configuring the DI.

And the Symfony docs also have more information on service tags.

So technically this is not a Shopware specific question, but rather a Symfony question. I hope my answer and the provided docs help you.

  • Related