File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,21 @@ $subMenu = $mainMenuBuilder->getSubMenu('Super Sub Menu');
347
347
348
348
You can only do this after the main menu has been built, this is because the main menu builder takes care of building all sub menus.
349
349
350
+ If you have already have a configured menu builder you can just pass that to ` addSubMenu ` and be done:
351
+
352
+ ``` php
353
+
354
+ $subMenuBuilder = (new CliMenuBuilder)
355
+ ->setTitle('Behold the awesomeness')
356
+ ->addItem(/** **/);
357
+
358
+ $menu = (new CliMenuBuilder)
359
+ ->addSubMenu('Super Sub Menu', $subMenuBuilder)
360
+ ->build();
361
+ ```
362
+
363
+ In this case ` addSubMenu ` will return the main menu builder, not the sub menu builder.
364
+
350
365
#### Disabling Items & Sub Menus
351
366
352
367
In this example we are disabling certain items and a submenu but still having them shown in the output.
You can’t perform that action at this time.
0 commit comments