Hi, I don't use Zend\Db\Adapter but you are more than welcome to see "how I get a db instance using a service manager". I aggressively try to make all classes I write standalone so I wrote my own ServiceManager that I utilise with ZF2's service manager. I have linked to classes below that hightlight this:
This is my own ServiceManager: https://bitbucket.org/latterd/smodels/src/41e32aef09c91fd797d5ebb5ef16307286215579/vendor/Supa/SupaServiceManager.php?at=master This is how I set up access to my ServiceManager in Module.php (getServiceConfig() method): https://bitbucket.org/latterd/smodels/src/41e32aef09c91fd797d5ebb5ef16307286215579/module/Application/Module.php?at=master This is how I access my ServiceManager from a Controller: https://bitbucket.org/latterd/smodels/src/41e32aef09c91fd797d5ebb5ef16307286215579/module/Application/src/Application/Controller/ReviewController.php?at=master Hope it helps you. Daniel On 10 August 2013 16:42, András Csányi <[email protected]> wrote: > Hi All, > > I'm going through the Getting started Zend Framework 2 tutorial and I > got the error message below at this [1] part of the material: > > Zend\ServiceManager\ServiceManager::get was unable to fetch or create > an instance for Zend\Db\Adapter\Adapter > > [1] - > http://framework.zend.com/manual/2.0/en/user-guide/database-and-models.html#using-servicemanager-to-configure-the-table-gateway-and-inject-into-the-albumtable > > I googled around and I found that not I'm the only one who have to > face this issue [2] and [3], etc. But those articles are about > developer version of ZF2, however, I'm using ZF 2.2.2. > > [2] - > http://stackoverflow.com/questions/11355126/how-do-i-get-the-service-manager-in-zend-framework-2-beta4-to-create-an-instance > > [3] - > http://stackoverflow.com/questions/11688260/servicenotfoundexception-in-zendframework-2-example-from-rob-allen > > I have tried every solution described these articles and suggested by > the community without any success. My question is that is there any > solution for this problem? Does anybody has a link which describe a > working solution for this? > > Thanks for any help in advance! > > András > > -- > -- Csanyi Andras (Sayusi Ando) -- http://sayusi.hu -- > http://facebook.com/andras.csanyi > -- ""Trust in God and keep your gunpowder dry!" - Cromwell > > -- > List: [email protected] > Info: http://framework.zend.com/archives > Unsubscribe: [email protected] > > >
