You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
I'd like to inject services (Symfony Routing Component for example) in a Column using Dependency Injection, like you can do with a FormType in Symfony.
I've no idea how to implement this in this library. Any ideas?
I am thinking about it since a long time and this should be very useful indeed.
To implement this, I think the first step will be to add a custom tag associated to the ColumnInterface.
So we will be able to easily identify all Column classes and then load them as services.
This can be done using with tag auto configuration: https://symfony.com/doc/current/service_container/tags.html#autoconfiguring-tags
Then, we will be able to pass all ColumnInterface services as an argument to the ColumnBuilder, for example using the !tagged keyword: https://symfony.com/doc/3.4/service_container/tags.html#reference-tagged-services
This means all Column classes will be passed to the ColumnBuilder as services (with automatic dependency injection) and we should be able to use them as normal service class.
Activity
Seb33300 commentedon Jul 3, 2019
I am thinking about it since a long time and this should be very useful indeed.
To implement this, I think the first step will be to add a custom tag associated to the
ColumnInterface.So we will be able to easily identify all
Columnclasses and then load them as services.This can be done using with tag auto configuration:
https://symfony.com/doc/current/service_container/tags.html#autoconfiguring-tags
Then, we will be able to pass all
ColumnInterfaceservices as an argument to theColumnBuilder, for example using the!taggedkeyword:https://symfony.com/doc/3.4/service_container/tags.html#reference-tagged-services
This means all
Columnclasses will be passed to theColumnBuilderas services (with automatic dependency injection) and we should be able to use them as normal service class.stephanvierkant commentedon Jul 3, 2019
I'm working on a Proof of Concept!