Open glerendegui opened 7 years ago
It seems that the docs needs to be updated to be more clear.
https://github.com/avanzu/AdminThemeBundle/blob/master/Resources/docs/knp_menu.md
Since the use of knp is optional, the package is not installed and "suggested", but I think that it is not detected at any place which is missing when you enable, so you get the ugly error/warning instead a useful message that says that you need install knpmenu
So you need first install with composer:
composer require knplabs/knp-menu-bundle
And you have 2 places where enable.
First it is using in general, which is under:
avanzu_admin_theme:
knp_menu: # knp menu integration
enable: true
But if you use the avanzu_admin_context, it requires enable in the context, which is under the "options" key, that is:
avanzu_admin_theme:
options:
knp_menu: # knp menu integration
enable: true
So two task to me here:
So i'm updating and have built my menu using
avanzu_admin_theme:
knp_menu: # knp menu integration
enable : true
and using a service
services:
orders.knp_menu_listener:
class: AppBundle\EventListener\ordersKnpMenuListener
arguments: ['@service_container']
tags:
- { name: kernel.event_listener, event: theme.sidebar_setup_knp_menu, method: onSetupKnpMenu}
so this use to work with beta5 but on beta10 this doesn't work no more I still get the same as original question if I dump out knp_menu
array:3 [▼
"enable" => false
"main_menu" => "avanzu_main"
"breadcrumb_menu" => false
]
How can I resolve it so my already created and working menu works?
Ok the following service is not getting picked up, adding it to my services resolved the problem.
avanzu_admin_theme.knp_menu_builder:
class: "%avanzu_admin_theme.knp_menu_builder.class%"
arguments:
- "@knp_menu.factory"
- "@avanzu_admin_theme.admin_router"
- "@event_dispatcher"
tags:
- {name: knp_menu.menu_builder, method: createMainMenu, alias: avanzu_main }
I'm having a problem with knp_menu. My config is
but when I put
{{ dump(avanzu_admin_context.knp_menu) }}
on default-layout.html.twig it dumpsSo, knp is never activated.
Also, (maybe this should go on another thread) if I change
default option at ContexHelper.php to true I get
Maybe I need to install knp bundle?