D
D
Dmitry Baskakov2021-07-01 08:23:59
Zend Framework
Dmitry Baskakov, 2021-07-01 08:23:59

How to use ServiceLocator in global scope?

There is a line

$recall = $this->getServiceLocator()->get(ReCalls::class);


And below is this line
$callsRepository = $this->getServiceLocator()->get(\Telephony\Repository\Calls::class);


The first one does not work, because it is in another module. And the second one works. Question: how to make ServiceLocator look for dependencies in all modules or at least in one I need?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Baskakov, 2021-07-02
@dmitrybascacov

It was necessary to check the Module.php file and the class autoload file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question