\Dewdrop\Cli\RendererRendererInterface

The interface CLI renderers must implement. Markdown is used by default, but alternate renders could be used to render directly to HTML, etc.

Summary

Methods
Constants
title()
subhead()
text()
table()
success()
warn()
error()
newline()
unorderedList()
ask()
secret()
select()
confirm()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

title()

title(string  $title) 

Display the primary title for the output.

Parameters

string $title

subhead()

subhead(string  $subhead) 

Display a subhead, or 2nd-level header.

Parameters

string $subhead

text()

text(string  $text) 

Display a single line or block of text.

Parameters

string $text

table()

table(array  $rows) 

Display a table. The supplied array should have the row title as the keys and the descriptions as the array values.

Parameters

array $rows

success()

success(string  $message) 

Display a success message.

Parameters

string $message

warn()

warn(string  $warning) 

Display a warning message.

Parameters

string $warning

error()

error(string  $error) 

Display an error message.

Parameters

string $error

newline()

newline() 

Display a newline/line break.

unorderedList()

unorderedList(array  $items) : \Dewdrop\Cli\Renderer\RendererInterface

Display an unordered (bulleted) list.

Parameters

array $items

Returns

\Dewdrop\Cli\Renderer\RendererInterface

ask()

ask(  $promptText, boolean  $allowEmpty = false) : string

Ask the user for a line of input.

Parameters

$promptText
boolean $allowEmpty

Returns

string

secret()

secret(  $promptText, boolean  $allowEmpty = false) : string

Ask the user for a line of input and don't display that input as they're typing. Ideal for passwords, etc.

Parameters

$promptText
boolean $allowEmpty

Returns

string

select()

select(  $promptText, array  $options, boolean  $allowEmpty = false) : string

Request that the user select an option from a list.

Parameters

$promptText
array $options
boolean $allowEmpty

Returns

string

confirm()

confirm(  $promptText) : boolean

Ask the user to answer a yes/no confirmation prompt.

Parameters

$promptText

Returns

boolean