Methods

Ask the user for a number.

__construct(string $promptText, bool $allowEmpty, bool $allowFloat, int $min, int $max) 

Parameters

$promptText

string

The prompt text to display in console

$allowEmpty

bool

Is empty response allowed?

$allowFloat

bool

Are floating (non-decimal) numbers allowed?

$min

int

Minimum value (inclusive)

$max

int

Maximum value (inclusive)

getAllowEmpty()

getAllowEmpty() : bool

Returns

bool

getAllowFloat()

getAllowFloat() : bool

Returns

bool

Return console adapter to use when showing prompt.

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

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

Returns

Return last answer to this prompt.

getLastResponse() : mixed
Inherited

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

Returns

mixed

getMax()

getMax() : int

Returns

int

getMaxLength()

getMaxLength() : int

Returns

int

getMin()

getMin() : 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()
inherited_from \Zend\Console\Prompt\Line::prompt()

Exceptions

\Zend\Console\Exception\BadMethodCallException

Returns

mixed

setAllowEmpty()

setAllowEmpty(bool $allowEmpty) 

Parameters

$allowEmpty

bool

setAllowFloat()

setAllowFloat(bool $allowFloat) 

Parameters

$allowFloat

bool

Set console adapter to use when showing prompt.

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

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

Parameters

setMax()

setMax(int $max) 

Parameters

$max

int

setMaxLength()

setMaxLength(int $maxLength) 

Parameters

$maxLength

int

setMin()

setMin(int $min) 

Parameters

$min

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
Inherited

inherited_from \Zend\Console\Prompt\Line::$$allowEmpty
 

$allowFloat

$allowFloat : bool

 

$console

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

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

$lastResponse

$lastResponse : mixed
Inherited

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

$max

$max : int

 

$maxLength

$maxLength : int
Inherited

inherited_from \Zend\Console\Prompt\Line::$$maxLength
 

$min

$min : int

 

$promptText

$promptText : string