HTMLConverter
in package
Converts tabular data into an HTML Table string.
Table of Contents
Properties
- $class_name : string
- table class attribute value.
- $column_attr : string
- $formatter : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64 callable(array<string|int, mixed>, Array): array<string|int, mixed>|null
- $id_value : string
- table id attribute value.
- $offset_attr : string
Methods
- __construct() : mixed
- convert() : string
- Converts a tabular data collection into an HTML table string.
- create() : self
- DEPRECATION WARNING! This method will be removed in the next major point release.
- formatter() : self
- Set a callback to format each item before json encode.
- table() : self
- HTML table class name setter.
- td() : self
- HTML td field name attribute setter.
- tr() : self
- HTML tr record offset attribute setter.
- when() : self
- Apply the callback if the given "condition" is (or resolves to) true.
- appendHeaderSection() : void
- Creates a DOMElement representing an HTML table heading section.
- filterAttributeNme() : bool
- supportsModernDom() : bool
Properties
$class_name
table class attribute value.
protected
string
$class_name
= 'table-csv-data'
$column_attr
protected
string
$column_attr
= ''
$formatter
protected
Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64
callable(array<string|int, mixed>, Array): array<string|int, mixed>|null
$formatter
= null
$id_value
table id attribute value.
protected
string
$id_value
= ''
$offset_attr
protected
string
$offset_attr
= ''
Methods
__construct()
public
__construct() : mixed
convert()
Converts a tabular data collection into an HTML table string.
public
convert(iterable<string|int, mixed>|TabularData|TabularDataProvider $records[, array<string|int, string> $header_record = [] ][, array<string|int, string> $footer_record = [] ]) : string
Parameters
- $records : iterable<string|int, mixed>|TabularData|TabularDataProvider
- $header_record : array<string|int, string> = []
-
An optional array of headers outputted using the
<thead>and<th>elements - $footer_record : array<string|int, string> = []
-
An optional array of footers outputted using the
<tfoot>and<th>elements
Return values
stringcreate()
DEPRECATION WARNING! This method will be removed in the next major point release.
public
static create() : self
Since version 9.22.0
use League\Csv\HTMLConverter::__construct()
Tags
Return values
selfformatter()
Set a callback to format each item before json encode.
public
formatter(
Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64
callable(array<string|int, mixed>, Array): array<string|int, mixed>|null $formatter) : self
Parameters
- $formatter : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64 callable(array<string|int, mixed>, Array): array<string|int, mixed>|null
Return values
selftable()
HTML table class name setter.
public
table(string $class_name[, string $id_value = '' ]) : self
Parameters
- $class_name : string
- $id_value : string = ''
Tags
Return values
selftd()
HTML td field name attribute setter.
public
td(string $fieldname_attribute_name) : self
Parameters
- $fieldname_attribute_name : string
Return values
selftr()
HTML tr record offset attribute setter.
public
tr(string $record_offset_attribute_name) : self
Parameters
- $record_offset_attribute_name : string
Return values
selfwhen()
Apply the callback if the given "condition" is (or resolves to) true.
public
when(callable($this): bool|bool $condition,
Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78
callable($this): Array $onSuccess[,
Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78
callable($this): Array|null $onFail = null ]) : self
Parameters
- $condition : callable($this): bool|bool
- $onSuccess : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78 callable($this): Array
- $onFail : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78 callable($this): Array|null = null
Return values
selfappendHeaderSection()
Creates a DOMElement representing an HTML table heading section.
protected
appendHeaderSection(string $node_name, array<string|int, mixed> $record, DOMElement|HTMLElement $table) : void
Parameters
- $node_name : string
- $record : array<string|int, mixed>
- $table : DOMElement|HTMLElement
Tags
filterAttributeNme()
private
static filterAttributeNme(string $attribute_name) : bool
Parameters
- $attribute_name : string
Return values
boolsupportsModernDom()
private
static supportsModernDom() : bool