package Default
inherited_from \Zend\Console\Prompt\AbstractPrompt

 Methods

Ask the user for an answer (a line of text)

__construct(string $promptText = 'Please enter value: ', boolean $allowEmpty = false, integer $maxLength = 2048

Parameters

$promptText

string

The prompt text to display in console

$allowEmpty

boolean

Is empty response allowed?

$maxLength

integer

Maximum response length

getAllowEmpty()

getAllowEmpty() : boolean

Returns

boolean

Return console adapter to use when showing prompt.

getConsole() : \Zend\Console\Adapter\AdapterInterface
Inherited
inherited_from \Zend\Console\Prompt\PromptInterface::getConsole()

Returns

\Zend\Console\Adapter\AdapterInterface

Return last answer to this prompt.

getLastResponse() : mixed
Inherited
inherited_from \Zend\Console\Prompt\PromptInterface::getLastResponse()

Returns

mixed

getMaxLength()

getMaxLength() : integer

Returns

integer

getPromptText()

getPromptText() : string

Returns

string

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

prompt() : mixed
InheritedStatic

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

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

Exceptions

\Zend\Console\Exception\BadMethodCallException

Returns

mixed

setAllowEmpty()

setAllowEmpty(boolean $allowEmpty) 

Parameters

$allowEmpty

boolean

Set console adapter to use when showing prompt.

setConsole(\Zend\Console\Adapter\AdapterInterface $adapter) 
Inherited
inherited_from \Zend\Console\Prompt\PromptInterface::setConsole()

Parameters

$adapter

\Zend\Console\Adapter\AdapterInterface

setMaxLength()

setMaxLength(integer $maxLength) 

Parameters

$maxLength

integer

setPromptText()

setPromptText(string $promptText) 

Parameters

$promptText

string

Show the prompt to user and return the answer.

show() : string

Returns

string

 Properties

 

$allowEmpty

$allowEmpty : boolean

Default

false
 

$console

$console : \Zend\Console\Adapter\AdapterInterface

Default

 

$lastResponse

$lastResponse : mixed

Default

 

$maxLength

$maxLength : integer

Default

2048
 

$promptText

$promptText : string

Default

'Please enter value: '