Documentation

Prompt
in package

Console prompt class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Properties

$formattedHeader  : string|null
$indent  : string
$inputStream  : mixed

Methods

__construct()  : mixed
Instantiate the prompt object
confirm()  : string
Display confirm message prompt
prompt()  : string
Get input from the prompt
promptMulti()  : array<string|int, mixed>
Display a prompt that accepts one or more comma-separated selections
getPromptInput()  : string
Get prompt input

Properties

$formattedHeader

protected string|null $formattedHeader = null

$indent

protected string $indent = ''

$inputStream

protected mixed $inputStream = null

Methods

__construct()

Instantiate the prompt object

public __construct([string $indent = '' ][, string|null $formattedHeader = null ][, mixed $inputStream = null ]) : mixed
Parameters
$indent : string = ''
$formattedHeader : string|null = null
$inputStream : mixed = null

confirm()

Display confirm message prompt

public confirm([string $message = 'Are you sure?' ][, array<string|int, mixed> $options = ['Y', 'N'] ][, bool $caseSensitive = false ][, int $length = 500 ][, bool $exit = true ]) : string
Parameters
$message : string = 'Are you sure?'
$options : array<string|int, mixed> = ['Y', 'N']
$caseSensitive : bool = false
$length : int = 500
$exit : bool = true
Return values
string

prompt()

Get input from the prompt

public prompt(string $prompt[, array<string|int, mixed>|null $options = null ][, bool $caseSensitive = false ][, int $length = 500 ]) : string
Parameters
$prompt : string
$options : array<string|int, mixed>|null = null
$caseSensitive : bool = false
$length : int = 500
Return values
string

promptMulti()

Display a prompt that accepts one or more comma-separated selections

public promptMulti(string $prompt, array<string|int, mixed> $options[, bool $caseSensitive = false ][, int $length = 500 ]) : array<string|int, mixed>
Parameters
$prompt : string
$options : array<string|int, mixed>
$caseSensitive : bool = false
$length : int = 500
Return values
array<string|int, mixed>

getPromptInput()

Get prompt input

protected getPromptInput(string $prompt[, int $length = 500 ][, bool $caseSensitive = false ]) : string
Parameters
$prompt : string
$length : int = 500
$caseSensitive : bool = false
Return values
string

        
On this page

Search results