Zend Framework 3 tutorial error -


i started yesterday zend framework 3 tutorial

but, at step :

when had module 'album' in modules.config.php had following error :

zend\servicemanager\exception\servicenotfoundexception /var/www/api/vendor/zendframework/zend-servicemanager/src/abstractpluginmanager.php:133 plugin name "getservicelocator" not found in plugin manager zend\mvc\controller\pluginmanager #0 /var/www/api/vendor/zendframework/zend-mvc/src/controller/pluginmanager.php(98): zend\servicemanager\abstractpluginmanager->get('getservicelocat...', null) #1 /var/www/api/vendor/zendframework/zend-mvc/src/controller/abstractcontroller.php(258): zend\mvc\controller\pluginmanager->get('getservicelocat...', null) #2 /var/www/api/vendor/zendframework/zend-mvc/src/controller/abstractcontroller.php(273): zend\mvc\controller\abstractcontroller->plugin('getservicelocat...') #3 /var/www/api/module/album/src/album/controller/albumcontroller.php(104): zend\mvc\controller\abstractcontroller->__call('getservicelocat...', array) #4 /var/www/api/module/album/src/album/controller/albumcontroller.php(104): album\controller\albumcontroller->getservicelocator() #5 /var/www/api/module/album/src/album/controller/albumcontroller.php(16): album\controller\albumcontroller->getalbumtable() #6 /var/www/api/vendor/zendframework/zend-mvc/src/controller/abstractactioncontroller.php(78): album\controller\albumcontroller->indexaction() #7 /var/www/api/vendor/zendframework/zend-eventmanager/src/eventmanager.php(271): zend\mvc\controller\abstractactioncontroller->ondispatch(object(zend\mvc\mvcevent)) #8 /var/www/api/vendor/zendframework/zend-eventmanager/src/eventmanager.php(151): zend\eventmanager\eventmanager->triggerlisteners(object(zend\mvc\mvcevent), object(closure)) #9 /var/www/api/vendor/zendframework/zend-mvc/src/controller/abstractcontroller.php(105): zend\eventmanager\eventmanager->triggereventuntil(object(closure), object(zend\mvc\mvcevent)) #10 /var/www/api/vendor/zendframework/zend-mvc/src/dispatchlistener.php(119): zend\mvc\controller\abstractcontroller->dispatch(object(zend\http\phpenvironment\request), object(zend\http\phpenvironment\response)) #11 /var/www/api/vendor/zendframework/zend-eventmanager/src/eventmanager.php(271): zend\mvc\dispatchlistener->ondispatch(object(zend\mvc\mvcevent)) #12 /var/www/api/vendor/zendframework/zend-eventmanager/src/eventmanager.php(151): zend\eventmanager\eventmanager->triggerlisteners(object(zend\mvc\mvcevent), object(closure)) #13 /var/www/api/vendor/zendframework/zend-mvc/src/application.php(332): zend\eventmanager\eventmanager->triggereventuntil(object(closure), object(zend\mvc\mvcevent)) #14 /var/www/api/public/index.php(48): zend\mvc\application->run() #15 {main} 

can me please, don't understand, follow tuto. !

namespace album;  use zend\router\http\segment;  return [      'router' => [         'routes' => [             'album' => [                 'type'    => segment::class,                 'options' => [                     'route' => '/album[/:action[/:id]]',                     'constraints' => [                         'action' => '[a-za-z][a-za-z0-9_-]*',                         'id'     => '[0-9]+',                     ],                     'defaults' => [                         'controller' => controller\albumcontroller::class,                         'action'     => 'index',                     ],                 ],             ],         ],     ],      'view_manager' => [         'template_path_stack' => [             'album' => __dir__ . '/../view',         ],     ], ]; 

in albumcontroller class, call getservicelocator(), should not have it. sure following official zf3 tutorial? there no getservicelocator() call in tutorial. should not have retrieve service manager controller, should inject necessary services in controller (it's zf3 way do).

i suggest remove code not in tutorial. once you'll finish (including in-depth tutorial), understand why should not have call getservicelocator() method controllers...


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -