0

Deprecated: You are retrieving the service locator from within the class Application\Controller\myController. Please be aware that ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceLocatorAwareInitializer. You will need to update your class to accept all dependencies at creation, either via constructor arguments or setters, and use a factory to perform the injections.

Kumar
  • 19
  • 3
  • Does this answer your question? [PHP Deprecated: You are retrieving the service locator from within the class ZFTool\Controller\ModuleController](https://stackoverflow.com/questions/35933113/php-deprecated-you-are-retrieving-the-service-locator-from-within-the-class-zft) – Ermenegildo Feb 14 '22 at 08:30
  • The question has been already asked several times (see [here](https://stackoverflow.com/questions/35933113/php-deprecated-you-are-retrieving-the-service-locator-from-within-the-class-zft)). Retrieving the service locator directly from the `Controller` is considered "wrong". If you want to remove the message **by solving the problem**, you must create a factory class for every controller and inject all dependencies when instantiating the controller class – Ermenegildo Feb 14 '22 at 08:37
  • Welcome to SO! Please see "[ask]" and the linked pages and "[MCVE]". We appreciate that you might be new, but we do expect evidence of the effort you've put into this. Where did you search? Why didn't it help? If it did, where is the code you wrote to test what you learned? If you didn't write code, why not? What is the minimal code that demonstrates the problem you encountered, along with the explanation of the problem, and the minimal input data and the expected result? Without that, it's hard to help you. – the Tin Man Feb 19 '22 at 20:08

0 Answers0