私はちょうど昨日Zend Framework 3 tutorialZend Frameworkの3チュートリアルエラー
を開始しました。しかし、at this step:
私はmodules.config.php
モジュール 'アルバム' を持っていたとき、私はこの次のエラーでした:
Zend\ServiceManager\Exception\ServiceNotFoundException
/var/www/api/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php:133
A plugin by the name "getServiceLocator" was not found in the 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}
ができます誰も私を助けてください、私は本当に理解していない、私はちょうどtutoに従います。 ありがとう!あなたのAlbumController
クラスで
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',
],
],
];
私は同じ問題があります – RPichioli
@Cochou 'module/Album/config/module.config.php'を付けてください。 –
@AlFonceはお返事ありがとう!ここをクリック: – Cochou