Fully Qualified Name: | Laminas\Console\Prompt\Checkbox |
Extends: | AbstractPrompt |
Name | Description | Defined By |
---|---|---|
__construct() | Ask the user to select any number of pre-defined options | Checkbox |
getConsole() | Return console adapter to use when showing prompt. | AbstractPrompt |
getLastResponse() | Return last answer to this prompt. | AbstractPrompt |
prompt() | Create an instance of this prompt, show it and return response. | AbstractPrompt |
setConsole() | Set console adapter to use when showing prompt. | AbstractPrompt |
show() | Show a list of options and prompt the user to select any number of them. | Checkbox |
Ask the user to select any number of pre-defined options
Parameter Name | Type | Description |
---|---|---|
$promptText | string | The |
$options | array|\Transversable | Allowed |
$echo | bool | True |
$ignoreCase |
Returns:
Return console adapter to use when showing prompt.
Returns: \ConsoleAdapter
Return last answer to this prompt.
Returns: mixed
Create an instance of this prompt, show it and return response.
This is a convenience method for creating statically creating prompts, i.e.:
$name = Laminas\Console\Prompt\Line::prompt("Enter your name: ");
Returns: mixed
Set console adapter to use when showing prompt.
Parameter Name | Type | Description |
---|---|---|
$adapter | \ConsoleAdapter |
Returns:
Show a list of options and prompt the user to select any number of them.
Returns: array Checked options