在我的 Laminas 网站上,我想使用 Navigatorframework。我遵循本教程,但我失败了。
/ - 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
有什么想法吗?我应该改变什么?
答案1
我忘记清理缓存了:rm /var/www/html/data/cache/*
然后它就起作用了。
答案2
配置加载模块(组件):层板\导航在模块.配置.php
https://docs.laminas.dev/laminas-navigation/quick-start/#register-laminas-navigation-as-module