-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Description
I can set keyboard mapping for regular callables but I would like to use it to open a submenu.. any way to achieve that?
$subMenu = function (CliMenuBuilder $b) {
$b->setTitle('Behold the awesomeness')
->addItem('Print Hello', function () { echo 'Hello!'; });
};
$exit = function (CliMenu $menu) {
$menu->close();
};
$menu = (new CliMenuBuilder)
->addSubMenu('[S]uper Sub Menu', $subMenu)
->build();
$menu->addCustomControlMapping('x', $exit);
$menu->addCustomControlMapping('s', $subMenu);
$menu->open();
Metadata
Metadata
Assignees
Labels
No labels