메소드 | 설명 | |
---|---|---|
__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 ) |
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 |
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 |
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 |
public getColumns ( ) : array | ||
리턴 | array | An array of column-type arrays. A column array has the following keys: key, name, attributes, columnClass. |