How do I get services (dependencies) in a custom class

前端 未结 5 468
礼貌的吻别
礼貌的吻别 2020-12-29 23:43

In the controller, I could do

$this->get(\'service.name\')

But in a custom class, how can I do that?

5条回答
  •  隐瞒了意图╮
    2020-12-30 00:12

    OK I suppose @Arms answer is a possible solution, I found by looking at the source to Controller, I could extend ContainerAware

提交回复
热议问题