gpt4 book ai didi

php - ZF3导航 "plugin"错误

转载 作者:可可西里 更新时间:2023-11-01 00:08:25 27 4
gpt4 key购买 nike

正在关注 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

最佳答案

运行

composer 需要 zendframework/zend-navigation

修复了在 zf3 中导航似乎没有默认安装的问题

关于php - ZF3导航 "plugin"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38577636/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com