Methods

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

__construct(string $promptText, bool $allowEmpty, int $maxLength) 

Parameters

$promptText

string

The prompt text to display in console

$allowEmpty

bool

Is empty response allowed?

$maxLength

int

Maximum response length

getAllowEmpty()

getAllowEmpty() : bool

Returns

bool

Return console adapter to use when showing prompt.

getConsole() : \Zend\Console\Adapter\AdapterInterface
Inherited

inherited_from \Zend\Console\Prompt\AbstractPrompt::getConsole()

Returns

Return last answer to this prompt.

getLastResponse() : mixed
Inherited

inherited_from \Zend\Console\Prompt\AbstractPrompt::getLastResponse()

Returns

mixed

getMaxLength()

getMaxLength() : int

Returns

int

getPromptText()

getPromptText() : string

Returns

string

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

prompt() : mixed
Inherited

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

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

inherited_from \Zend\Console\Prompt\AbstractPrompt::prompt()

Exceptions

\Zend\Console\Exception\BadMethodCallException

Returns

mixed

setAllowEmpty()

setAllowEmpty(bool $allowEmpty) 

Parameters

$allowEmpty

bool

Set console adapter to use when showing prompt.

setConsole(\Zend\Console\Adapter\AdapterInterface $adapter) 
Inherited

inherited_from \Zend\Console\Prompt\AbstractPrompt::setConsole()

Parameters

setMaxLength()

setMaxLength(int $maxLength) 

Parameters

$maxLength

int

setPromptText()

setPromptText(string $promptText) 

Parameters

$promptText

string

Show the prompt to user and return the answer.

show() : mixed

Returns

mixed

 Properties

 

$allowEmpty

$allowEmpty : bool

 

$console

$console : \Zend\Console\Adapter\AdapterInterface
Inherited

inherited_from \Zend\Console\Prompt\AbstractPrompt::$$console
 

$lastResponse

$lastResponse : mixed
Inherited

inherited_from \Zend\Console\Prompt\AbstractPrompt::$$lastResponse
 

$maxLength

$maxLength : int

 

$promptText

$promptText : string