|
38 | 38 | * [Borders](#borders)
|
39 | 39 | * [Exit Button Text](#exit-button-text)
|
40 | 40 | * [Remove Exit Button](#remove-exit-button)
|
41 |
| - * [Item Markers](#item-markers) |
42 |
| - * [Item Extra](#item-extra) |
43 | 41 | * [Items](#appearance)
|
44 | 42 | * [Selectable Item](#selectable-item)
|
45 | 43 | * [Line Break Item](#line-break-item)
|
46 | 44 | * [Static Item](#static-item)
|
47 | 45 | * [Ascii Art Item](#ascii-art-item)
|
48 | 46 | * [Sub Menu Item](#sub-menu-item)
|
49 | 47 | * [Disabling Items & Sub Menus](#disabling-items--sub-menus)
|
| 48 | + * [Item Markers](#item-markers) |
| 49 | + * [Item Extra](#item-extra) |
50 | 50 | * [Menu Methods](#menu-methods)
|
51 | 51 | * [Redrawing the Menu](#redrawing-the-menu)
|
52 | 52 | * [Getting, Removing and Adding items](#getting-removing-and-adding-items)
|
@@ -385,36 +385,6 @@ $menu = (new CliMenuBuilder)
|
385 | 385 | ->build();
|
386 | 386 | ```
|
387 | 387 |
|
388 |
| -##### Item Markers |
389 |
| - |
390 |
| -The marker displayed by the side of the currently active item can be modified, UTF-8 characters are supported. |
391 |
| -The marker for un-selected items can also be modified. If you want to disable it, just set it to a space character. |
392 |
| - |
393 |
| -```php |
394 |
| -$menu = (new CliMenuBuilder) |
395 |
| - ->setUnselectedMarker('❅') |
396 |
| - ->setSelectedMarker('✏') |
397 |
| - |
398 |
| - //disable unselected marker |
399 |
| - ->setUnselectedMarker(' ') |
400 |
| - ->build(); |
401 |
| -``` |
402 |
| - |
403 |
| -#### Item Extra |
404 |
| - |
405 |
| -You can optionally display some arbitrary text on the right hand side of an item. You can customise this text and |
406 |
| -you indicate which items to display it on. We use it to display `[COMPLETED]` on completed exercises, where the menu lists |
407 |
| -exercises for a workshop application. |
408 |
| - |
409 |
| -The third parameter to `addItem` is a boolean whether to show the item extra or not. It defaults to false. |
410 |
| - |
411 |
| -```php |
412 |
| -$menu = (new CliMenuBuilder) |
413 |
| - ->setItemExtra('✔') |
414 |
| - ->addItem('Exercise 1', function (CliMenu $menu) { echo 'I am complete!'; }, true) |
415 |
| - ->build(); |
416 |
| -``` |
417 |
| - |
418 | 388 | #### Items
|
419 | 389 |
|
420 | 390 | There a few different types of items you can add to your menu
|
@@ -606,6 +576,36 @@ The third param on the `->addItem` call is what disables an item while the `->di
|
606 | 576 |
|
607 | 577 | The outcome is a full menu with dimmed rows to denote them being disabled. When a user navigates these items are jumped over to the next available selectable item.
|
608 | 578 |
|
| 579 | +##### Item Markers |
| 580 | + |
| 581 | +The marker displayed by the side of the currently active item can be modified, UTF-8 characters are supported. |
| 582 | +The marker for un-selected items can also be modified. If you want to disable it, just set it to a space character. |
| 583 | + |
| 584 | +```php |
| 585 | +$menu = (new CliMenuBuilder) |
| 586 | + ->setUnselectedMarker('❅') |
| 587 | + ->setSelectedMarker('✏') |
| 588 | + |
| 589 | + //disable unselected marker |
| 590 | + ->setUnselectedMarker(' ') |
| 591 | + ->build(); |
| 592 | +``` |
| 593 | + |
| 594 | +#### Item Extra |
| 595 | + |
| 596 | +You can optionally display some arbitrary text on the right hand side of an item. You can customise this text and |
| 597 | +you indicate which items to display it on. We use it to display `[COMPLETED]` on completed exercises, where the menu lists |
| 598 | +exercises for a workshop application. |
| 599 | + |
| 600 | +The third parameter to `addItem` is a boolean whether to show the item extra or not. It defaults to false. |
| 601 | + |
| 602 | +```php |
| 603 | +$menu = (new CliMenuBuilder) |
| 604 | + ->setItemExtra('✔') |
| 605 | + ->addItem('Exercise 1', function (CliMenu $menu) { echo 'I am complete!'; }, true) |
| 606 | + ->build(); |
| 607 | +``` |
| 608 | + |
609 | 609 | ### Menu Methods
|
610 | 610 |
|
611 | 611 | The next set of documentation applies to methods available directly on the `\PhpSchool\CliMenu\CliMenu` instance. Typically
|
|
0 commit comments