Jackdaw's Nest A Web Log

[ Log ] [ Projects ] [ About ]

Posts tagged with dependency injection

# Playing Around With Symfony Service Container 2015/11/30

Lately, I've been playing around with the Symfony Service Container. For some reason, I've never really liked it that much and I've prefered Pimple that comes with Silex framework. Defining services in YML files instead of plain PHP always felt odd.

But I think I've changed my mind now. I've just created a largish project in Symfony and now I quite like the Symfony way of defining the services. It gives you a nice distinction between configuration and your business logic. Defining the services in YML is just the configuration part, and PHP is only used for real code. That's actually pretty nice and feels good after you get used to it.