In previous tutorials in this Symfony container course we injected our dependencies via the service constructor. In this tutorial we are going to use setter methods to do this.
Using setter method injection is very useful especially if you are using a factory design pattern or if you have optional dependencies that you wish to set after the service has been instantiated.
We are going to continue using our validation classes that we built in previous tutorials and inject configuration when retrieving these classes from the Symfony service container.
Code can be found on github:
If you would like to join me and other web developers on Discord then signup to be a Patron. Other benefits to being a patron include gaining early access to future tutorials, joining a newsletter and getting discounts on programming courses and resources.
You will also be supporting continuation and growth of the channel.
Become a Patron: http://bit.ly/2wK4F0U
======== RECOMMENDED PROGRAMMING RESOURCES ========
Manning programming books and courses: http://bit.ly/2BIrExp
PHP Hosting from Cloudways:
======== MY PROGRAMMING COURSES ========
======== WEB HOSTING DEALS ========
======== SUBSCRIBE TO THE NEWSLETTER ========
Join the Newsletter: http://bit.ly/2fPlG3v
======== FOLLOW ME ========
======== MY CONFERENCE/USER GROUP TALKS ========
======== SUPPORT THE CHANNEL ========
======== VIDEO SETUP ========
Nikon D5300 Camera: http://amzn.to/2u5jreD
Logitech HD Pro Webcam C920 http://amzn.to/2C5NNVJ
CRAPHY Photography Studio Lights: http://amzn.to/2BThzOc
Rode Procaster Microphone: http://amzn.to/2sH2WJ1
Rode VideoMic Pro: http://amzn.to/2vmNF0D
Zoom H4NPro: http://amzn.to/2kZrrvo