Dependency Injection #[Attributes]
In modern Symfony, services can be configured using native PHP attributes, integrating configuration directly within the code. Let’s explore this with a practical example.
- intermediate
- 387 students
- EN/ES Captions
- EN/ES Script
- Certificate of Completion
Your Guides
About this course
Traditionally, Symfony services were configured in XML or YAML files. This creates a bit of a disconnect between your code and the configuration. In modern Symfony, we can use native PHP attributes to configure services. This allows us to keep our service configuration right in our code as native PHP metadata, which is pretty cool! Let's dive into these Dependency Injection attributes in the context of a fun example.
Next courses in the Symfony 7: Learn More Tricks section of the Symfony 7 Track!
3 Comments
Thank you very much for this course. I love these courses that go beyond the fundamentals. And the new speaker is also great, although of course I miss Ryan.
Thanks for your feedback! That sounds like we are moving in the right direction.
Stay safe and happy coding! Cheers!
Looking forward to this course! Thank you!