Skip to content
PHP Ecosystem
Explore

Table

API reference › Debug Core › Helper › Table

final classPHPForge\Debug\Helper\Table
Sourcesrc/Helper/Table.php

Builds the shared debugger table shell: an optional column-header row above the body rows, inside a scroll wrapper.

MethodDescriptionDefined by
build() staticBuilds the <table> element, prepending a <thead> row of <th scope="col"> cells when labels are supplied.Table
render() staticRenders the table shell inside its scroll wrapper.Table
public static function build(list<string> $headers, list<UIAwesome\Html\Table\Tr> $rows, string $class = \PHPForge\Debug\Theme\Css::TABLE): UIAwesome\Html\Table\Table

Builds the <table> element, prepending a <thead> row of <th scope="col"> cells when labels are supplied.

Exposed on its own so sections that decorate the shell (extra attributes, a fixed layout) still share one header and body contract.

Parameters

ParameterTypeDescription
$headerslist<string>Column labels, or [] for a table without a header row.
$rowslist<UIAwesome\Html\Table\Tr>Body rows in display order.
$classstringTable CSS classes.

Returns

UIAwesome\Html\Table\Table: Table element.

public static function render(list<string> $headers, list<UIAwesome\Html\Table\Tr> $rows, string $tableClass = \PHPForge\Debug\Theme\Css::TABLE, string $wrapClass = \PHPForge\Debug\Theme\Css::TABLE_WRAP): string

Renders the table shell inside its scroll wrapper.

Parameters

ParameterTypeDescription
$headerslist<string>Column labels, or [] for a table without a header row.
$rowslist<UIAwesome\Html\Table\Tr>Body rows in display order.
$tableClassstringTable CSS classes.
$wrapClassstringScroll-wrapper CSS classes.

Returns

string: Wrapped table markup.