PHP Класс Webmozart\Console\UI\Component\Table

You can add rows to the table with {@link addRow()}. You may optionally set a header row with {@link setHeaderRow()}. If you want to style the table, pass a {@link TableStyle} instance to the constructor.
С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Наследование: implements Webmozart\Console\UI\Component
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( TableStyle $style = null ) Creates a new table.
addRow ( array $row ) : static Adds a row to the table.
addRows ( array $rows ) : static Adds rows to the table.
render ( IO $io, integer $indentation ) Renders the table.
setHeaderRow ( array $row ) : static Sets the header cells of the table.
setRow ( integer $index, array $row ) : static Sets a specific row in the table.
setRows ( array $rows ) : static Sets the rows in the table.

Приватные методы

Метод Описание
getCellWrapper ( Webmozart\Console\Api\Formatter\Formatter $formatter, $screenWidth, $excessColumnWidth, $indentation )
renderRows ( IO $io, array $rows, array $columnLengths, $excessColumnLength, $indentation )

Описание методов

__construct() публичный Метод

Creates a new table.
public __construct ( TableStyle $style = null )
$style Webmozart\Console\UI\Style\TableStyle The rendering style. By default, the table is rendered with the style {@link TableStyle::asciiBorder()}.

addRow() публичный Метод

Adds a row to the table.
public addRow ( array $row ) : static
$row array An array of data cells.
Результат static The current instance.

addRows() публичный Метод

Adds rows to the table.
public addRows ( array $rows ) : static
$rows array The rows to add.
Результат static The current instance.

render() публичный Метод

Renders the table.
public render ( IO $io, integer $indentation )
$io Webmozart\Console\Api\IO\IO The I/O.
$indentation integer The number of spaces to indent.

setHeaderRow() публичный Метод

Sets the header cells of the table.
public setHeaderRow ( array $row ) : static
$row array The header cells.
Результат static The current instance.

setRow() публичный Метод

Sets a specific row in the table.
public setRow ( integer $index, array $row ) : static
$index integer The row index.
$row array An array of data cells.
Результат static The current instance.

setRows() публичный Метод

Sets the rows in the table.
public setRows ( array $rows ) : static
$rows array The rows to set.
Результат static The current instance.