Class Line

Summary

Fully Qualified Name: Laminas\Console\Prompt\Line
Extends: AbstractPrompt

Description

Methods

Name Description Defined By
__construct() Ask the user for an answer (a line of text) Line
getAllowEmpty() Line
getConsole() Return console adapter to use when showing prompt. AbstractPrompt
getLastResponse() Return last answer to this prompt. AbstractPrompt
getMaxLength() Line
getPromptText() Line
prompt() Create an instance of this prompt, show it and return response. AbstractPrompt
setAllowEmpty() Line
setConsole() Set console adapter to use when showing prompt. AbstractPrompt
setMaxLength() Line
setPromptText() Line
show() Show the prompt to user and return the answer. Line

Method Details

__construct()

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

Parameter Name Type Description
$promptText string The
$allowEmpty bool Is
$maxLength int Maximum

Returns:

getAllowEmpty()

Returns: bool

getConsole()

Return console adapter to use when showing prompt.

Returns: \ConsoleAdapter

getLastResponse()

Return last answer to this prompt.

Returns: mixed

getMaxLength()

Returns: int

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 = Laminas\Console\Prompt\Line::prompt("Enter your name: ");

Returns: mixed

setAllowEmpty()

Parameter Name Type Description
$allowEmpty bool

Returns:

setConsole()

Set console adapter to use when showing prompt.

Parameter Name Type Description
$adapter \ConsoleAdapter

Returns:

setMaxLength()

Parameter Name Type Description
$maxLength int

Returns:

setPromptText()

Parameter Name Type Description
$promptText string

Returns:

show()

Show the prompt to user and return the answer.

Returns: string

Top