package Default
inherited_from \Zend\Console\Prompt\Line

 Methods

Ask the user for a number.

__construct(string $promptText = 'Please enter a number: ', boolean $allowEmpty = false, boolean $allowFloat = false, integer $min = null, integer $max = null
inherited_from \Zend\Console\Prompt\Line::__construct()

Parameters

$promptText

string

The prompt text to display in console

$allowEmpty

boolean

Is empty response allowed?

$allowFloat

boolean

Are floating (non-decimal) numbers allowed?

$min

integer

Minimum value (inclusive)

$max

integer

Maximum value (inclusive)

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

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

Parameters

$promptText

string

The prompt text to display in console

$allowEmpty

boolean

Is empty response allowed?

$maxLength

integer

Maximum response length

getAllowEmpty()

getAllowEmpty() : boolean
inherited_from \Zend\Console\Prompt\Line::getAllowEmpty()

Returns

boolean

getAllowEmpty()

getAllowEmpty() : boolean
Inherited

Returns

boolean

getAllowFloat()

getAllowFloat() : 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

getMax()

getMax() : integer

Returns

integer

getMaxLength()

getMaxLength() : integer
inherited_from \Zend\Console\Prompt\Line::getMaxLength()

Returns

integer

getMaxLength()

getMaxLength() : integer
Inherited

Returns

integer

getMin()

getMin() : integer

Returns

integer

getPromptText()

getPromptText() : string
inherited_from \Zend\Console\Prompt\Line::getPromptText()

Returns

string

getPromptText()

getPromptText() : string
Inherited

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

Parameters

$allowEmpty

boolean

setAllowEmpty()

setAllowEmpty(boolean $allowEmpty) 
Inherited

Parameters

$allowEmpty

boolean

setAllowFloat()

setAllowFloat(boolean $allowFloat) 

Parameters

$allowFloat

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

setMax()

setMax(integer $max) 

Parameters

$max

integer

setMaxLength()

setMaxLength(integer $maxLength) 
inherited_from \Zend\Console\Prompt\Line::setMaxLength()

Parameters

$maxLength

integer

setMaxLength()

setMaxLength(integer $maxLength) 
Inherited

Parameters

$maxLength

integer

setMin()

setMin(integer $min) 

Parameters

$min

integer

setPromptText()

setPromptText(string $promptText) 
inherited_from \Zend\Console\Prompt\Line::setPromptText()

Parameters

$promptText

string

setPromptText()

setPromptText(string $promptText) 
Inherited

Parameters

$promptText

string

Show the prompt to user and return the answer.

show() : mixed
inherited_from \Zend\Console\Prompt\Line::show()

Returns

mixed

Show the prompt to user and return the answer.

show() : string
Inherited

Returns

string

 Properties

 

$allowEmpty

$allowEmpty : boolean

Default

false
 

$allowFloat

$allowFloat : boolean

Default

false
 

$console

$console : \Zend\Console\Adapter\AdapterInterface

Default

 

$lastResponse

$lastResponse : mixed

Default

 

$max

$max : integer

Default

 

$maxLength

$maxLength : integer

Default

2048
 

$min

$min : integer

Default

 

$promptText

$promptText : string

Default

'Please enter a number: '
inherited_from \Zend\Console\Prompt\Line::promptText
 

$promptText

$promptText : string

Default

'Please enter value: '