PHP 클래스 TableSummaryModule, vanilla

부터: 2.3
저자: Becky Van Bussel ([email protected])
상속: extends Gdn_Module
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $title = '' )
addColumn ( string $key, string $name = '', array $attributes = [], string $columnClass = '' ) : TableSummaryModule Add a column to the table.
addColumnIf ( boolean | string | array $isAllowed, string $key, string $name = '', array $attributes = [], string $columnClass = '' ) : TableSummaryModule Add a column to the table if it satisfies the $isAllowed condition.
addRow ( array $row = [], string $key = '', array $attributes = [] ) : TableSummaryModule Adds a row to the table. Constrains our data to the columns we've added.
getColumns ( ) : array
getRows ( ) : array
getTitle ( ) : string
prepare ( ) : boolean Prepares the media item for rendering. Adds column-type css classes to cells in the table.
setTitle ( string $title )

메소드 상세

__construct() 공개 메소드

public __construct ( $title = '' )

addColumn() 공개 메소드

Add a column to the table.
public addColumn ( string $key, string $name = '', array $attributes = [], string $columnClass = '' ) : TableSummaryModule
$key string The key name of the column.
$name string The display-name of the column.
$attributes array The attributes for the heading cell.
$columnClass string The css class to propagate to every cell in this column.
리턴 TableSummaryModule $this

addColumnIf() 공개 메소드

Add a column to the table if it satisfies the $isAllowed condition.
public addColumnIf ( boolean | string | array $isAllowed, string $key, string $name = '', array $attributes = [], string $columnClass = '' ) : TableSummaryModule
$isAllowed boolean | string | array Either a boolean to indicate whether to actually add the item or a permission string or array of permission strings (full match) to check.
$key string The key name of the column.
$name string The display-name of the column.
$attributes array The attributes for the th cell.
$columnClass string The css class to propagate to every cell in this column.
리턴 TableSummaryModule $this

addRow() 공개 메소드

Adds a row to the table. Constrains our data to the columns we've added.
public addRow ( array $row = [], string $key = '', array $attributes = [] ) : TableSummaryModule
$row array An array representing a row where the key matches a column key and the value is either an HTML-formatted string or an object with a toString() method. (Something echo-able.)
$key string The key for the row. Nothing to do with the column key. Here for expansion, like in case we want to sort items eventually.
$attributes array The attributes on the tr element.
리턴 TableSummaryModule $this

getColumns() 공개 메소드

public getColumns ( ) : array
리턴 array An array of column-type arrays. A column array has the following keys: key, name, attributes, columnClass.

getRows() 공개 메소드

public getRows ( ) : array
리턴 array An array of row-type arrays. Each row array has a cells and attributes key. The cells key holds an array of 'column-key' => 'cell-content' data.

getTitle() 공개 메소드

public getTitle ( ) : string
리턴 string The table title.

prepare() 공개 메소드

Prepares the media item for rendering. Adds column-type css classes to cells in the table.
public prepare ( ) : boolean
리턴 boolean Whether to render the module.

setTitle() 공개 메소드

public setTitle ( string $title )
$title string