class Table

Class Table Simple table helper for CLI output which allows the display of tabular data

Methods

__construct(Output $output)

Table constructor.

addColumn(string $id, string $caption, array $options = [])

Add columns for output. The

fillByArray(array $array)

Fills the table with a passed data array containing rows and their named/keyed columns Special Keys: _separator Set this key and will it with a separator caption to output a separator line

fillByModelCollection($collection)

Fill by Model Collection

print()

Outputs the whole table

Details

at line 24
__construct(Output $output)

Table constructor.

Parameters

Output $output

at line 54
addColumn(string $id, string $caption, array $options = [])

Add columns for output. The

Parameters

string $id

Column Id - must match the column key in the data array

string $caption

Caption which shall be displayed in the column header

array $options

Additional options for the column. Currently supported: color -> Format column in passed color as defined in shell_input::color()

at line 34
fillByArray(array $array)

Fills the table with a passed data array containing rows and their named/keyed columns Special Keys: _separator Set this key and will it with a separator caption to output a separator line

Parameters

array $array

at line 41
fillByModelCollection($collection)

Fill by Model Collection

Parameters

$collection

at line 61
print()

Outputs the whole table