正在關注https://docs.zendframework.com/zend-navigation/quick-start/,我嘗試爲我的應用程序進行導航。我註冊了一個導航,我將DefaultNavigationFactory添加到服務管理器,但是當我嘗試打印導航時出現錯誤。ZF3導航「插件」錯誤
這是我的模塊/應用/配置/ module.config.php:
namespace Application;
use Zend\Navigation\Service\DefaultNavigationFactory;
use Zend\ServiceManager\Factory\InvokableFactory;
use Zend\View\Helper\Navigation;
return [
'navigation' => [
'default' => [
/* ... */
]
] ,
'service_manager' => [
'factories' => [
'navigation' => DefaultNavigationFactory::class,
],
],
];
但當$this->navigation('default')->menu()
,我得到這個錯誤,不包括堆棧跟蹤:
Fatal error: Uncaught Zend\ServiceManager\Exception\ServiceNotFoundException: A plugin by the name "navigation" was not found in the plugin manager Zend\View\HelperPluginManager in C:\Users\bikke_000\Documents\Sites\slapenenzo\vendor\zendframework\zend-servicemanager\src\AbstractPluginManager.php:133