|
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) | |
| read () | |
Public Member Functions inherited from EntryInterface | |
Data Fields | |
| bool | $returnOptionKey = false |
Protected Attributes | |
| readonly string | $label |
| readonly array | $options |
| string | $selectionInvalidMessage = null |
| string | $prompt = '> ' |
Provides the user with a menu to choose a single option.
After user selection, the option label is returned, except if SingleSelector::$returnOptionKey is TRUE (default is FALSE), in which case the selected key is returned.
Definition at line 17 of file SingleSelector.php.
| __construct | ( | string | $label, |
| array | $options ) |
| string | $label | |
| array<string> | $options |
| InvalidArgumentException |
Definition at line 40 of file SingleSelector.php.
| read | ( | ) |
Implements EntryInterface.
Definition at line 74 of file SingleSelector.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 68 of file SingleSelector.php.
| setSelectionInvalidMessage | ( | string | $message | ) |
Sets a message to be displayed when an invalid value is selected.
| string | $message |
Definition at line 55 of file SingleSelector.php.
|
protected |
Definition at line 19 of file SingleSelector.php.
|
protected |
Definition at line 24 of file SingleSelector.php.
|
protected |
Definition at line 26 of file SingleSelector.php.
| bool $returnOptionKey = false |
Definition at line 32 of file SingleSelector.php.
|
protected |
Definition at line 25 of file SingleSelector.php.