menu-builder
menu-builder copied to clipboard
how to know its a top lavel menu and has no child
i am greateful to using it . its nice work done. please let me know if there is any api to check current menu is top label menu like $menu->hasChild() thanks
Hmm.. you can check if it's at the bottom of a tree with $menu->hasItems()
.
There isn't currently anything built in for checking the top of a tree. You could add an option when you create the top level menu
$topMenu = new MenuItem([ 'top-level' => true ]);
I might add something in to handle top level menus, though.