Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Table

Fonctions membres publiques

 __construct (OutputInterface $output)
 
 setStyle ($name)
 
 getStyle ()
 
 setColumnStyle (int $columnIndex, $name)
 
 getColumnStyle (int $columnIndex)
 
 setColumnWidth (int $columnIndex, int $width)
 
 setColumnWidths (array $widths)
 
 setColumnMaxWidth (int $columnIndex, int $width)
 
 setHeaders (array $headers)
 
 setRows (array $rows)
 
 addRows (array $rows)
 
 addRow ($row)
 
 appendRow ($row)
 
 setRow ($column, array $row)
 
 setHeaderTitle (?string $title)
 
 setFooterTitle (?string $title)
 
 setHorizontal (bool $horizontal=true)
 
 render ()
 

Fonctions membres publiques statiques

static setStyleDefinition (string $name, TableStyle $style)
 
static getStyleDefinition (string $name)
 

Fonctions membres privées

 renderRowSeparator (int $type=self::SEPARATOR_MID, string $title=null, string $titleFormat=null)
 
 renderColumnSeparator (int $type=self::BORDER_OUTSIDE)
 
 renderRow (array $row, string $cellFormat, string $firstCellFormat=null)
 
 renderCell (array $row, int $column, string $cellFormat)
 
 calculateNumberOfColumns (array $rows)
 
 calculateRowCount ()
 
 fillNextRows (array $rows, int $line)
 
 fillCells (iterable $row)
 
 copyRow (array $rows, int $line)
 
 getNumberOfColumns (array $row)
 
 getRowColumns (array $row)
 
 calculateColumnsWidth (iterable $rows)
 
 getColumnSeparatorWidth ()
 
 getCellWidth (array $row, int $column)
 
 cleanup ()
 
 resolveStyle ($name)
 

Fonctions membres privées statiques

static initStyles ()
 

Attributs privés

const SEPARATOR_TOP = 0
 
const SEPARATOR_TOP_BOTTOM = 1
 
const SEPARATOR_MID = 2
 
const SEPARATOR_BOTTOM = 3
 
const BORDER_OUTSIDE = 0
 
const BORDER_INSIDE = 1
 
 $headerTitle
 
 $footerTitle
 
 $headers = []
 
 $rows = []
 
 $horizontal = false
 
 $effectiveColumnWidths = []
 
 $numberOfColumns
 
 $output
 
 $style
 
 $columnStyles = []
 
 $columnWidths = []
 
 $columnMaxWidths = []
 
 $rendered = false
 

Attributs privés statiques

static $styles
 

Description détaillée

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( OutputInterface  $output)

Références Table\$output, et Table\setStyle().

Documentation des fonctions membres

◆ addRow()

addRow (   $row)
Renvoie
$this

Références $this.

Référencé par Table\addRows(), et Table\appendRow().

◆ addRows()

addRows ( array  $rows)
Renvoie
$this

Références Table\$rows, $this, et Table\addRow().

Référencé par Table\setRows().

◆ appendRow()

appendRow (   $row)

Adds a row to the table, and re-renders the table.

Renvoie
$this

Références $this, Table\addRow(), Table\calculateRowCount(), class, et Table\render().

◆ calculateColumnsWidth()

calculateColumnsWidth ( iterable  $rows)
private

◆ calculateNumberOfColumns()

calculateNumberOfColumns ( array  $rows)
private

Calculate number of columns for this table.

Références $columns, Table\$rows, et Table\getNumberOfColumns().

Référencé par Table\render().

◆ calculateRowCount()

calculateRowCount ( )
private

Référencé par Table\appendRow().

◆ cleanup()

cleanup ( )
private

Called after rendering to cleanup cache data.

Références null.

Référencé par Table\render().

◆ copyRow()

copyRow ( array  $rows,
int  $line 
)
private

Références Table\$rows.

Référencé par Table\fillNextRows().

◆ fillCells()

fillCells ( iterable  $row)
private

fill cells for a row that contains colspan > 1.

Références $position, et TableCell\getColspan().

◆ fillNextRows()

fillNextRows ( array  $rows,
int  $line 
)
private

fill rows that contains rowspan > 1.

Exceptions
InvalidArgumentException

Références Table\$numberOfColumns, Table\$rows, $value, Table\copyRow(), Table\getNumberOfColumns(), TableCell\getRowspan(), et null.

◆ getCellWidth()

getCellWidth ( array  $row,
int  $column 
)
private

◆ getColumnSeparatorWidth()

getColumnSeparatorWidth ( )
private

Références Helper\width().

Référencé par Table\renderCell().

◆ getColumnStyle()

getColumnStyle ( int  $columnIndex)

Gets the current style for a column.

If style was not set, it returns the global table style.

Renvoie
TableStyle

Références Table\getStyle().

Référencé par Table\renderCell().

◆ getNumberOfColumns()

getNumberOfColumns ( array  $row)
private

Gets number of columns by row.

Références $columns.

Référencé par Table\calculateNumberOfColumns(), et Table\fillNextRows().

◆ getRowColumns()

getRowColumns ( array  $row)
private

Gets list of columns for the given row.

Références $columns, et TableCell\getColspan().

Référencé par Table\renderRow().

◆ getStyle()

getStyle ( )

Gets the current table style.

Renvoie
TableStyle

Références Table\$style.

Référencé par Table\getColumnStyle().

◆ getStyleDefinition()

static getStyleDefinition ( string  $name)
static

Gets a style definition by name.

Renvoie
TableStyle

Références $name.

Référencé par SymfonyStyle\createTable().

◆ initStyles()

static initStyles ( )
staticprivate
Renvoie
array<string, TableStyle>

◆ render()

render ( )

Renders table to output.

Example:

+---------------+-----------------------+------------------+
| ISBN          | Title                 | Author           |
+---------------+-----------------------+------------------+
| 99921-58-10-7 | Divine Comedy         | Dante Alighieri  |
| 9971-5-0210-0 | A Tale of Two Cities  | Charles Dickens  |
| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
+---------------+-----------------------+------------------+

Références $header, Table\$horizontal, $i, Table\$rows, Table\calculateColumnsWidth(), Table\calculateNumberOfColumns(), Table\cleanup(), elseif, null, Table\renderRow(), et Table\renderRowSeparator().

Référencé par Table\appendRow().

◆ renderCell()

renderCell ( array  $row,
int  $column,
string  $cellFormat 
)
private

◆ renderColumnSeparator()

renderColumnSeparator ( int  $type = self::BORDER_OUTSIDE)
private

Renders vertical column separator.

Références $type.

Référencé par Table\renderRow().

◆ renderRow()

renderRow ( array  $row,
string  $cellFormat,
string  $firstCellFormat = null 
)
private

Renders table row.

Example:

| 9971-5-0210-0 | A Tale of Two Cities  | Charles Dickens  |

Références $columns, $i, $last, Table\getRowColumns(), Table\renderCell(), et Table\renderColumnSeparator().

Référencé par Table\render().

◆ renderRowSeparator()

renderRowSeparator ( int  $type = self::SEPARATOR_MID,
string  $title = null,
string  $titleFormat = null 
)
private

Renders horizontal header separator.

Example:

+-----+-----------+-------+

Références $count, Table\$horizontal, $limit, $title, $type, elseif, null, Helper\removeDecoration(), Helper\substr(), et Helper\width().

Référencé par Table\render().

◆ resolveStyle()

resolveStyle (   $name)
private

Références $name.

Référencé par Table\setColumnStyle(), et Table\setStyle().

◆ setColumnMaxWidth()

setColumnMaxWidth ( int  $columnIndex,
int  $width 
)

Sets the maximum width of a column.

Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while formatted strings are preserved.

Renvoie
$this

Références $this, $width, et class.

◆ setColumnStyle()

setColumnStyle ( int  $columnIndex,
  $name 
)

Sets table column style.

Paramètres
TableStyle | string$nameThe style name or a TableStyle instance
Renvoie
$this

Références $name, $this, et Table\resolveStyle().

◆ setColumnWidth()

setColumnWidth ( int  $columnIndex,
int  $width 
)

Sets the minimum width of a column.

Renvoie
$this

Références $this, et $width.

Référencé par Table\setColumnWidths().

◆ setColumnWidths()

setColumnWidths ( array  $widths)

Sets the minimum width of all columns.

Renvoie
$this

Références $this, $width, et Table\setColumnWidth().

◆ setFooterTitle()

setFooterTitle ( ?string  $title)
Renvoie
$this

Références $this, et $title.

◆ setHeaders()

setHeaders ( array  $headers)
Renvoie
$this

Références Table\$headers, et $this.

◆ setHeaderTitle()

setHeaderTitle ( ?string  $title)
Renvoie
$this

Références $this, et $title.

◆ setHorizontal()

setHorizontal ( bool  $horizontal = true)
Renvoie
$this

Références Table\$horizontal, et $this.

◆ setRow()

setRow (   $column,
array  $row 
)
Renvoie
$this

Références $this.

◆ setRows()

setRows ( array  $rows)

Références Table\addRows().

◆ setStyle()

setStyle (   $name)

Sets table style.

Paramètres
TableStyle | string$nameThe style name or a TableStyle instance
Renvoie
$this

Références $name, $this, et Table\resolveStyle().

Référencé par Table\__construct().

◆ setStyleDefinition()

static setStyleDefinition ( string  $name,
TableStyle  $style 
)
static

Sets a style definition.

Références $name, et Table\$style.

Documentation des champs

◆ $columnMaxWidths

$columnMaxWidths = []
private

◆ $columnStyles

$columnStyles = []
private

◆ $columnWidths

$columnWidths = []
private

◆ $effectiveColumnWidths

$effectiveColumnWidths = []
private

Column widths cache.

◆ $footerTitle

$footerTitle
private

◆ $headers

$headers = []
private

Table headers.

Référencé par Table\setHeaders().

◆ $headerTitle

$headerTitle
private

◆ $horizontal

$horizontal = false
private

◆ $numberOfColumns

$numberOfColumns
private

◆ $output

$output
private

Référencé par Table\__construct().

◆ $rendered

$rendered = false
private

◆ $rows

◆ $style

$style
private

◆ $styles

$styles
staticprivate

◆ BORDER_INSIDE

const BORDER_INSIDE = 1
private

◆ BORDER_OUTSIDE

const BORDER_OUTSIDE = 0
private

◆ SEPARATOR_BOTTOM

const SEPARATOR_BOTTOM = 3
private

◆ SEPARATOR_MID

const SEPARATOR_MID = 2
private

◆ SEPARATOR_TOP

const SEPARATOR_TOP = 0
private

◆ SEPARATOR_TOP_BOTTOM

const SEPARATOR_TOP_BOTTOM = 1
private

La documentation de cette classe a été générée à partir du fichier suivant :