在我的 Laminas 站点上,我想使用 Navigator 框架。我按照本教程进行操作,但失败了。
/ - Uncaught Laminas\ServiceManager\Exception\ServiceNotFoundException: A plugin by the name "navigation" was not found in the plugin manager Laminas\View\HelperPluginManager in /var/www/html/vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php:143
Stack trace:
#0 /var/www/html/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(375): Laminas\ServiceManager\AbstractPluginManager->get('navigation', NULL)
#1 /var/www/html/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(393): Laminas\View\Renderer\PhpRenderer->plugin('navigation')
#2 /var/www/html/module/Application/view/layout/layout.phtml(18): Laminas\View\Renderer\PhpRenderer->__call('navigation', Array)
#3 /var/www/html/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(505): include('/var/www/htm...')
#4 /var/www/html/vendor/laminas/laminas-view/src/View.php(206): Laminas\View\Renderer\PhpRenderer->render(NULL)
#5 /var/www/html/vendor/laminas/laminas-mvc/src/View/Http/Default in /var/www/html/vendor/laminas/laminas-servicemanager/src/AbstractPluginManager.php on line 143
任何想法,我应该改变什么?
我忘了清理缓存:
rm /var/www/html/data/cache/*
然后它起作用了。
加载模块(组件)的配置:modules.config.php 中的Laminas\Navigation
https://docs.laminas.dev/laminas-navigation/quick-start/#register-laminas-navigation-as-module