menu-builder icon indicating copy to clipboard operation
menu-builder copied to clipboard

how to know its a top lavel menu and has no child

Open saurovh opened this issue 10 years ago • 1 comments

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

saurovh avatar Jul 22 '14 20:07 saurovh

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.

tedslittlerobot avatar Sep 23 '14 15:09 tedslittlerobot