Archived video

This video is archived and won't be updated. We're keeping it online for now as a courtesy.

Alternate resources: 

Autowiring Madness in Symfony 3

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    Oh! Bonus feature!
  • 0:10
    In services.yml, remove arguments and instead just say autowire: true.
  • 0:17
    Refresh again.
  • 0:21
    It still works, but how?
  • 0:24
    We didn't tell Symfony what arguments to pass to our constructor.
  • 0:28
    What madness is this?
  • 0:31
    OK, with autowire: true, Symfony reads the type-hints
  • 0:36
    for each constructor argument and tries to automatically find
  • 0:39
    the correct service to pass to you.
  • 0:41
    In this case, it saw the MarkdownTransformer type-hint

Autowiring Madness in Symfony 3

Loading...

In this lesson you'll learn what happens when you set autowire to true when you register your service.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.