Class Select

Summary

Fully Qualified Name: Zend\Console\Prompt\Select
Extends: Char

Description

Methods

Name Description Defined By
__construct() Ask the user to select one of pre-defined options Select
getAllowEmpty() Char
getAllowedChars() Char
getConsole() Return console adapter to use when showing prompt. AbstractPrompt
getEcho() Char
getIgnoreCase() Char
getLastResponse() Return last answer to this prompt. AbstractPrompt
getOptions() Select
getPromptText() Char
prompt() Create an instance of this prompt, show it and return response. AbstractPrompt
setAllowEmpty() Char
setAllowedChars() Char
setConsole() Set console adapter to use when showing prompt. AbstractPrompt
setEcho() Char
setIgnoreCase() Char
setOptions() Set allowed options Select
setPromptText() Char
show() Show a list of options and prompt the user to select one of them. Select

Method Details

__construct()

Ask the user to select one of pre-defined options

Parameter Name Type Description
$promptText string The
$options array Allowed
$allowEmpty bool Allow
$echo bool True

Returns:

getAllowEmpty()

Returns: bool

getAllowedChars()

Returns: string

getConsole()

Return console adapter to use when showing prompt.

Returns: \ConsoleAdapter

getEcho()

Returns: bool

getIgnoreCase()

Returns: bool

getLastResponse()

Return last answer to this prompt.

Returns: mixed

getOptions()

Returns: array

getPromptText()

Returns: string

prompt()

Create an instance of this prompt, show it and return response.

This is a convenience method for creating statically creating prompts, i.e.:

$name = Zend\Console\Prompt\Line::prompt("Enter your name: ");

Returns: mixed

setAllowEmpty()

Parameter Name Type Description
$allowEmpty bool

Returns:

setAllowedChars()

Parameter Name Type Description
$allowedChars string

Returns:

setConsole()

Set console adapter to use when showing prompt.

Parameter Name Type Description
$adapter \ConsoleAdapter

Returns:

setEcho()

Parameter Name Type Description
$echo bool

Returns:

setIgnoreCase()

Parameter Name Type Description
$ignoreCase bool

Returns:

setOptions()

Set allowed options

Parameter Name Type Description
$options array|\Traversable

Returns:

setPromptText()

Parameter Name Type Description
$promptText string

Returns:

show()

Show a list of options and prompt the user to select one of them.

Returns: string Selected option

Top