How I can call method getServiceManager in constructor of controller?
If I in action method it's ok
public function __construct()
{
$this->logger = $this->getEvent()->getApplication()->getServiceManager()->get("Zend\Log\Logger\Debug");
}
, but in constructor getServiceManager give error:
Call to a member function getServiceManager() on null in C:\htdocs\test-zend2\module\Application\src\Controller\IndexController.php on line 32.