search

Home  >  Q&A  >  body text

symfony - How to use $this->get non-bundle in your own newly created class.

  1. I am using edusoho. It is developed based on symfony2. There is a service folder in it that provides operations on the database (not the service in the configuration file in symfony2). This service is not a bundle and is not in registerBundles. Registration is actually a lot of folders containing custom classes. I want to use $this->get in this custom class to obtain services just like using $this->get in the controller. How to do it? Woolen cloth?

我想大声告诉你我想大声告诉你2744 days ago473

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-05-16 16:45:43

    。。。。。。。

    reply
    0
  • PHPz

    PHPz2017-05-16 16:45:43

    This depends on container and you need to inject it

    reply
    0
  • Cancelreply