B
B
BonBon Slick2020-12-12 01:29:13
symfony
BonBon Slick, 2020-12-12 01:29:13

Autoconfigure + autowire for controllers?

<service id="App\Controller\PublicController">
            <tag name="controller.service_arguments"/>
        </service>


How can you make an automatic DI controller a service?

AbstractController cannot be inherited, and ServiceSubscriberInterface cannot be used.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BonBon Slick, 2021-01-12
@BonBonSlick

<prototype namespace="App\Application\Controller\"
                   resource="../src/Application/Controller/"
        >
            <tag name="controller.service_arguments"/>
        </prototype>
    </services>
</container>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question