Adding Parameters to Dependency Injected Objects
In the last post, I touched on how you can define a service in your mymodule.services.yml file and pass it parameters to configure the object when it is injected as a dependency into other classes.
Topic archive
Every article filed under dependency injection, grouped by year.
In the last post, I touched on how you can define a service in your mymodule.services.yml file and pass it parameters to configure the object when it is injected as a dependency into other classes.
In my latest adventures in Drupal 8, I had to build out a multisite search with Solr. While I will touch on that later, I wanted to call out something I learned today, which is how to inject dependencies to your Drupal class with non-native Drupal code. What do I mean by that?