Skip to content

Commit 4f8fb10

Browse files
committed
Reorganise doc a little bit
1 parent 9c40849 commit 4f8fb10

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@
3030
* [Examples](#examples)
3131
* [API](#api)
3232
* [Appearance](#appearance)
33+
* [Menu Title](#menu-title)
34+
* [Colour](#colour)
3335
* [Width](#width)
3436
* [Padding](#padding)
3537
* [Margin](#margin)
3638
* [Borders](#borders)
3739
* [Exit Button Text](#exit-button-text)
3840
* [Remove Exit Button](#remove-exit-button)
41+
* [Item Markers](#item-markers)
3942
* [Item Extra](#item-extra)
4043
* [Items](#appearance)
4144
* [Selectable Item](#selectable-item)
@@ -44,11 +47,10 @@
4447
* [Ascii Art Item](#ascii-art-item)
4548
* [Sub Menu Item](#sub-menu-item)
4649
* [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)
5254
* [Dialogues](#dialogues)
5355
* [Flash](#flash)
5456
* [Confirm](#confirm)
@@ -187,6 +189,18 @@ $menu->close();
187189

188190
#### Appearance
189191

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+
190204
##### Colour
191205

192206
You can change the foreground and background colour of the menu to any of the following colours:
@@ -386,18 +400,6 @@ $menu = (new CliMenuBuilder)
386400
->build();
387401
```
388402

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-
401403
#### Item Extra
402404

403405
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
604606

605607
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.
606608

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+
607614
#### Redrawing the Menu
608615

609616
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

Comments
 (0)