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
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__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.