|
Text UI
A simple and fast way to take user input and display output in text mode using PHP.
|
Public Member Functions | |
| __construct (string $label, array $options) | |
| setSelectionInvalidMessage (string $message) | |
| setPrompt (string $prompt) | |
| setDefaultOptions (mixed ... $default) | |
| read () | |
Public Member Functions inherited from EntryInterface | |
Data Fields | |
| bool | $returnOptionKey = false |
| bool | $clearScreen = true |
Protected Attributes | |
| readonly string | $label |
| readonly array | $options |
| string | $selectionInvalidMessage = null |
| string | $prompt = '> ' |
| array | $selection = [] |
Provides the user with a menu to choose multiple options.
After user selection ended (end with BLANK ENTER), the options labels are returned, except if MultiSelector::$returnOptionKey is TRUE (default is FALSE), in which case the selected keys are returned.
Definition at line 19 of file MultiSelector.php.
| __construct | ( | string | $label, |
| array | $options ) |
| string | $label | |
| array<string> | $options |
| InvalidArgumentException |
Definition at line 54 of file MultiSelector.php.
| read | ( | ) |
Implements EntryInterface.
Definition at line 108 of file MultiSelector.php.
| setDefaultOptions | ( | mixed ... | $default | ) |
Defines which options will be selected by default.
| int | string | $default | Sequence with the indexes of the selected standard options. |
Definition at line 94 of file MultiSelector.php.
| setPrompt | ( | string | $prompt | ) |
Sets a prompt message to be displayed in the space reserved for the user to type the option. The default is >.
| string | $prompt |
Definition at line 82 of file MultiSelector.php.
| setSelectionInvalidMessage | ( | string | $message | ) |
Sets a message to be displayed when an invalid value is selected.
| string | $message |
Definition at line 69 of file MultiSelector.php.
| bool $clearScreen = true |
Definition at line 46 of file MultiSelector.php.
|
protected |
Definition at line 21 of file MultiSelector.php.
|
protected |
Definition at line 26 of file MultiSelector.php.
|
protected |
Definition at line 28 of file MultiSelector.php.
| bool $returnOptionKey = false |
Definition at line 39 of file MultiSelector.php.
|
protected |
Definition at line 33 of file MultiSelector.php.
|
protected |
Definition at line 27 of file MultiSelector.php.