class OutputStyle extends SymfonyStyle (View source)

concrete5's output style.

Inspiration goes to illuminate/console

Properties

private OutputInterface $output

Methods

void
__construct(InputInterface $input, OutputInterface $output)

Create a new Console OutputStyle instance.

string
askWithCompletion($question, array $choices, null $default = null, null $attempts = null, bool $strict = false)

Ask a question with autocompletion

secret($question, $fallback = true)

No description

string
askSecretQuestion($question, bool $fallback = true)

Ask a question while hiding the response

mixed
choice(string $question, array $choices, null $default = null, null $attempts = null, null $multiple = null)

Ask a question with a list of allowed answers

table(array $headers, array $rows, string $tableStyle = 'default', array $columnStyles = [])

Create a table instance

columns(array $values, int $width = 5, string $tableStyle = 'compact', array $columnStyles = [])

Output in even width columns

chunk(array $values, $size)

No description

getColumnWidths($width)

No description

Details

void __construct(InputInterface $input, OutputInterface $output)

Create a new Console OutputStyle instance.

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

string askWithCompletion($question, array $choices, null $default = null, null $attempts = null, bool $strict = false)

Ask a question with autocompletion

Parameters

$question
array $choices
null $default
null $attempts
bool $strict

Return Value

string

secret($question, $fallback = true)

No description

Parameters

$question
$fallback

See also

askSecretQuestion

string askSecretQuestion($question, bool $fallback = true)

Ask a question while hiding the response

Parameters

$question
bool $fallback

Return Value

string

mixed choice(string $question, array $choices, null $default = null, null $attempts = null, null $multiple = null)

Ask a question with a list of allowed answers

Parameters

string $question
array $choices
null $default
null $attempts
null $multiple

Return Value

mixed

table(array $headers, array $rows, string $tableStyle = 'default', array $columnStyles = [])

Create a table instance

Parameters

array $headers
array $rows
string $tableStyle
array $columnStyles

See also

\Symfony\Component\Console\Helper\Table::initStyles()

columns(array $values, int $width = 5, string $tableStyle = 'compact', array $columnStyles = [])

Output in even width columns

Parameters

array $values
int $width
string $tableStyle
array $columnStyles

protected chunk(array $values, $size)

No description

Parameters

array $values
$size

private getColumnWidths($width)

No description

Parameters

$width