PHP 클래스 Webmozart\Console\UI\Component\Grid

You can add data cells with {@link addCell()}. Optionally, you can set the minimum and maximum allowed number of columns with {@link setMinNbColumns()} and {@link setMaxNbColumns()}. If you want to style the grid, pass a {@link GridStyle} to the constructor.
부터: 1.0
저자: Bernhard Schussek ([email protected])
상속: implements Webmozart\Console\UI\Component
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( GridStyle $style = null ) Creates a new grid.
addCell ( string $cell ) : static Adds a data cell to the grid.
addCells ( array $cells ) : static Adds data cells to the grid.
getMaxNbColumns ( ) : integer Returns the maximum number of columns in the grid.
getMinNbColumns ( ) : integer Returns the minimum number of columns in the grid.
render ( IO $io, integer $indentation ) Renders the grid.
setCells ( array $cells ) : static Sets the data cells in the grid.
setMaxNbColumns ( integer $maxNbColumns ) : static Sets the maximum number of columns in the grid.
setMinNbColumns ( integer $minNbColumns ) : static Sets the minimum number of columns in the grid.

비공개 메소드들

메소드 설명
getCellWrapper ( Webmozart\Console\Api\Formatter\Formatter $formatter, $screenWidth, $excessColumnWidth, $indentation )
renderRows ( IO $io, array $rows, array $columnLengths, $excessColumnLength, $indentation )

메소드 상세

__construct() 공개 메소드

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

addCell() 공개 메소드

Adds a data cell to the grid.
public addCell ( string $cell ) : static
$cell string The data cell.
리턴 static The current instance.

addCells() 공개 메소드

Adds data cells to the grid.
public addCells ( array $cells ) : static
$cells array The data cells.
리턴 static The current instance.

getMaxNbColumns() 공개 메소드

The default maximum is unlimited.
public getMaxNbColumns ( ) : integer
리턴 integer The maximum number of columns.

getMinNbColumns() 공개 메소드

The default minimum is 4.
public getMinNbColumns ( ) : integer
리턴 integer The minimum number of columns.

render() 공개 메소드

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

setCells() 공개 메소드

Sets the data cells in the grid.
public setCells ( array $cells ) : static
$cells array The data cells to set.
리턴 static The current instance.

setMaxNbColumns() 공개 메소드

The default maximum is unlimited.
public setMaxNbColumns ( integer $maxNbColumns ) : static
$maxNbColumns integer The maximum number of columns.
리턴 static The current instance.

setMinNbColumns() 공개 메소드

The default minimum is 4.
public setMinNbColumns ( integer $minNbColumns ) : static
$minNbColumns integer The minimum number of columns.
리턴 static The current instance.