Table
class Table
Table helper.
Traits
Helper trait.
Properties
protected Output | $output | Output instance. | |
protected FormatterInterface|null | $formatter | Formatter. |
Methods
int
stringWidthWithoutFormatting(string $string)
Returns the width of the string without formatting.
from HelperTrait
bool
isValidInput(array $columnNames, array $rows)
Checks if the number of cells in each row matches the number of columns.
array
getColumnWidths(array $columnNames, array $rows)
Returns an array containing the maximum width of each column.
string
buildRowSeparator(array $columnWidths, string $separator = '-')
Builds a row separator.
string
buildTableRow(array $colums, array $columnWidths)
Builds a table row.
string
render(array $columnNames, array $rows)
Renders a table.
draw(array $columnNames, array $rows, int $writer = Output::STANDARD)
Draws a table.
Details
in HelperTrait at line 25
protected int
stringWidthWithoutFormatting(string $string)
Returns the width of the string without formatting.
at line 48
__construct(Output $output)
Constructor.
at line 62
protected bool
isValidInput(array $columnNames, array $rows)
Checks if the number of cells in each row matches the number of columns.
at line 87
protected array
getColumnWidths(array $columnNames, array $rows)
Returns an array containing the maximum width of each column.
at line 125
protected string
buildRowSeparator(array $columnWidths, string $separator = '-')
Builds a row separator.
at line 139
protected string
buildTableRow(array $colums, array $columnWidths)
Builds a table row.
at line 158
string
render(array $columnNames, array $rows)
Renders a table.
at line 196
draw(array $columnNames, array $rows, int $writer = Output::STANDARD)
Draws a table.