编程语言
首页 > 编程语言> > php – ZF3导航“插件”错误

php – ZF3导航“插件”错误

作者:互联网

https://docs.zendframework.com/zend-navigation/quick-start/之后,我尝试为我的应用程序进行导航.我注册了导航,我将DefaultNavigationFactory添加到服务管理器,但是当我尝试打印导航时出现错误.

这是我的模块/ Application / config / 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

解决方法:

运行

作曲家需要zendframework / zend-navigation

修复了默认情况下没有安装zf3导航的问题

标签:zend-navigation,php,zend-framework3
来源: https://codeday.me/bug/20190722/1502576.html