Avolutions\Console\ConsoleTable
Helper to create tables for Console output.
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates and initializes a new ConsoleTable instance. |
addRow() | public | Adds an array with row values. |
addRows() | public | Adds multiple rows to the table. |
render() | public | Displays the table to the Console output. |
setHeader() | public | Set the header columns for the table. |
Method Details
__construct()
Creates and initializes a new ConsoleTable instance.
public
__construct(Console $Console[, array<string|int, mixed> $rows = [] ][, bool $useFirstRowAsHeader = true ]) : mixed
Parameters
Console
$Console
Console instance for output.
array<string|int, mixed>
$rows
(optional)
Multidimensional array with row values.
bool
$useFirstRowAsHeader
(optional)
First row is used as header (true) or not (false).
addRow()
Adds an array with row values.
public
addRow(array<string|int, mixed> $row) : void
Parameters
array<string|int, mixed>
$row
Array with row values.
Return values
void Adds an array with row values.addRows()
Adds multiple rows to the table.
public
addRows(array<string|int, mixed> $rows) : void
Parameters
array<string|int, mixed>
$rows
Multidimensional array with row values.
Return values
void Adds multiple rows to the table.render()
Displays the table to the Console output.
public
render([array<string|int, mixed> $rows = [] ][, bool $useFirstRowAsHeader = true ]) : void
Parameters
array<string|int, mixed>
$rows
(optional)
Multidimensional array with row values.
bool
$useFirstRowAsHeader
(optional)
First row is used as header (true) or not (false).