Zend Framework
3.0
|
Public Member Functions | |
__construct ($promptText= 'Please select one option', $options=[], $allowEmpty=false, $echo=false) | |
Ask the user to select one of pre-defined options. | |
show () | |
Show a list of options and prompt the user to select one of them. | |
setOptions ($options) | |
Set allowed options. | |
getOptions () | |
Public Member Functions inherited from Char | |
__construct ($promptText= 'Please hit a key', $allowedChars= '0123456789abcdefghijklmnopqrstuvwxyz', $ignoreCase=true, $allowEmpty=false, $echo=true) | |
Ask the user for a single key stroke. | |
show () | |
Show the prompt to user and return a single char. | |
setAllowEmpty ($allowEmpty) | |
getAllowEmpty () | |
setPromptText ($promptText) | |
getPromptText () | |
setAllowedChars ($allowedChars) | |
getAllowedChars () | |
setIgnoreCase ($ignoreCase) | |
getIgnoreCase () | |
setEcho ($echo) | |
getEcho () | |
Public Member Functions inherited from AbstractPrompt | |
getLastResponse () | |
Return last answer to this prompt. | |
getConsole () | |
Return console adapter to use when showing prompt. | |
setConsole (ConsoleAdapter $adapter) | |
Set console adapter to use when showing prompt. | |
Protected Attributes | |
$promptText = 'Please select an option' | |
$ignoreCase = true | |
$options = [] | |
Protected Attributes inherited from Char | |
$promptText | |
$allowEmpty | |
$allowedChars | |
$ignoreCase | |
$echo | |
Protected Attributes inherited from AbstractPrompt | |
$console | |
$lastResponse | |
Additional Inherited Members | |
Static Public Member Functions inherited from AbstractPrompt | |
static | prompt () |
Create an instance of this prompt, show it and return response. | |
__construct | ( | $promptText = 'Please select one option' , |
|
$options = [] , |
|||
$allowEmpty = false , |
|||
$echo = false |
|||
) |
Ask the user to select one of pre-defined options.
string | $promptText | The prompt text to display in console |
array | $options | Allowed options |
bool | $allowEmpty | Allow empty (no) selection? |
bool | $echo | True to display selected option? |
Exception\BadMethodCallException | if no options available |
getOptions | ( | ) |
setOptions | ( | $options | ) |
Set allowed options.
array | \Traversable | $options |
Exception\BadMethodCallException |
show | ( | ) |
Show a list of options and prompt the user to select one of them.
Implements PromptInterface.
|
protected |
|
protected |
|
protected |