|
30 | 30 | * [Examples](#examples)
|
31 | 31 | * [API](#api)
|
32 | 32 | * [Appearance](#appearance)
|
| 33 | + * [Menu Title](#menu-title) |
| 34 | + * [Colour](#colour) |
33 | 35 | * [Width](#width)
|
34 | 36 | * [Padding](#padding)
|
35 | 37 | * [Margin](#margin)
|
36 | 38 | * [Borders](#borders)
|
37 | 39 | * [Exit Button Text](#exit-button-text)
|
38 | 40 | * [Remove Exit Button](#remove-exit-button)
|
| 41 | + * [Item Markers](#item-markers) |
39 | 42 | * [Item Extra](#item-extra)
|
40 | 43 | * [Items](#appearance)
|
41 | 44 | * [Selectable Item](#selectable-item)
|
|
44 | 47 | * [Ascii Art Item](#ascii-art-item)
|
45 | 48 | * [Sub Menu Item](#sub-menu-item)
|
46 | 49 | * [Disabling Items & Sub Menus](#disabling-items--sub-menus)
|
47 |
| - * [Item Markers](#item-markers) |
48 |
| - * [Menu Title](#menu-title) |
49 |
| - * [Redrawing the Menu](#redrawing-the-menu) |
50 |
| - * [Getting, Removing and Adding items](#getting-removing-and-adding-items) |
51 |
| - * [Custom Control Mapping](#custom-control-mapping) |
| 50 | + * [Menu Methods](#menu-methods) |
| 51 | + * [Redrawing the Menu](#redrawing-the-menu) |
| 52 | + * [Getting, Removing and Adding items](#getting-removing-and-adding-items) |
| 53 | + * [Custom Control Mapping](#custom-control-mapping) |
52 | 54 | * [Dialogues](#dialogues)
|
53 | 55 | * [Flash](#flash)
|
54 | 56 | * [Confirm](#confirm)
|
@@ -187,6 +189,18 @@ $menu->close();
|
187 | 189 |
|
188 | 190 | #### Appearance
|
189 | 191 |
|
| 192 | +##### Menu Title |
| 193 | + |
| 194 | +You can give your menu a title and you can customise the separator, a line which displays under the title. |
| 195 | +Whatever string you pass to `setTitleSeparator` will be repeated for the width of the Menu. |
| 196 | + |
| 197 | +```php |
| 198 | +$menu = (new CliMenuBuilder) |
| 199 | + ->setTitle('One Menu to rule them all!') |
| 200 | + ->setTitleSeparator('*-') |
| 201 | + ->build(); |
| 202 | +``` |
| 203 | + |
190 | 204 | ##### Colour
|
191 | 205 |
|
192 | 206 | You can change the foreground and background colour of the menu to any of the following colours:
|
@@ -386,18 +400,6 @@ $menu = (new CliMenuBuilder)
|
386 | 400 | ->build();
|
387 | 401 | ```
|
388 | 402 |
|
389 |
| -##### Menu Title |
390 |
| - |
391 |
| -You can give your menu a title and you can customise the separator, a line which displays under the title. |
392 |
| -Whatever string you pass to `setTitleSeparator` will be repeated for the width of the Menu. |
393 |
| - |
394 |
| -```php |
395 |
| -$menu = (new CliMenuBuilder) |
396 |
| - ->setTitle('One Menu to rule them all!') |
397 |
| - ->setTitleSeparator('*-') |
398 |
| - ->build(); |
399 |
| -``` |
400 |
| - |
401 | 403 | #### Item Extra
|
402 | 404 |
|
403 | 405 | You can optionally display some arbitrary text on the right hand side of an item. You can customise this text and
|
@@ -604,6 +606,11 @@ The third param on the `->addItem` call is what disables an item while the `->di
|
604 | 606 |
|
605 | 607 | 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.
|
606 | 608 |
|
| 609 | +### Menu Methods |
| 610 | + |
| 611 | +The next set of documentation applies to methods available directly on the `\PhpSchool\CliMenu\CliMenu` instance. Typically |
| 612 | +you will invoke these methods whilst your menu is open in you action callbacks. |
| 613 | + |
607 | 614 | #### Redrawing the Menu
|
608 | 615 |
|
609 | 616 | You can modify the menu and its style when executing an action and then you can redraw it! In this example we will toggle the background
|
|
0 commit comments