Using own Application class in ZF2

60 views Asked by At

I have been playing with my own MyApplication class (extending Zend\Mvc\Application) in ZF2.

In index.php I use

MyApplication::init(
   // here goes system config...
)->run();

One essential problem with this is that ServiceManager will still set Zend\Mvc\Application as the 'Application' service.

I noticed that in Zend\Mvc\Service\ServiceListenerFactory where the default Application factory is defined, there is a note that this default MVC-related service configuration can be overridden by modules. I was playing with it but was not able to make my MyApplication instance as the 'Application' service.

I am using ZF2 version 2.2.6. Any hints would be appreciated.

0

There are 0 answers