Answer the question
In order to leave comments, you need to log in
How to properly use DI container with constructor injection in ZF2?
How to properly inject a dependency through an interface through a class constructor?
In Module::getServiceConfig() I described the factory through a class that implements the Zend\ServiceManager\FactoryInterface interface:
'factories' => [
'MyModule\Model\RelatedLists\ServiceInterface' => 'MyModule\Model\RelatedLists\Factory\ServiceFactory',
]
public function __construct(\MyModule\Model\RelatedLists\ServiceInterface $service) {...}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question