Archived video

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

Alternate resources: 

Register Your Service in the Container using 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
    The MarkdownTransformer class is not an Autobot, nor a Decepticon,
  • 0:14
    but it is a service because it does work for us.
  • 0:17
    It's no different from any other service,
  • 0:20
    like the markdown.parser, logger, or anything else we see in debug:container,
  • 0:27
    except for 1 thing, it sees dead people.
  • 0:31
    I mean, our service does not live in the container.
  • 0:35
    Nope, we need to instantiate it manually.
  • 0:38
    We can't just say something like $this->get('app.markdown_transformer')
  • 0:44
    and expect the container to create it for us.
  • 0:47
    Time to change that,

Register Your Service in the Container using Symfony 3

Loading...

In this lesson, you'll learn how to register your service in the container so that you can can access it in your class.

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.