\League\CsvHTMLConverter

Converts tabular data into an HTML Table string.

Summary

Methods
Properties
Constants
__construct()
convert()
table()
tr()
td()
No public properties found
No constants found
appendHeaderSection()
addHTMLAttributes()
$class_name
$id_value
$xml_converter
N/A
No private methods found
No private properties found
N/A

Properties

$class_name

$class_name : string

table class attribute value.

Type

string

$id_value

$id_value : string

table id attribute value.

Type

string

Methods

__construct()

__construct() 

New Instance.

convert()

convert(array|\Traversable  $records, array<mixed,string>  $header_record = array(), array<mixed,string>  $footer_record = array()) 

Converts a tabular data collection into a HTML table string.

Parameters

array|\Traversable $records

The tabular data collection

array<mixed,string> $header_record

An optional array of headers outputted using the<thead> section

array<mixed,string> $footer_record

An optional array of footers to output to the table using <tfoot> and <th> elements

table()

table(\League\Csv\string  $class_name, \League\Csv\string  $id_value = '') 

HTML table class name setter.

Parameters

\League\Csv\string $class_name
\League\Csv\string $id_value

Throws

\DOMException

if the id_value contains any type of whitespace

tr()

tr(\League\Csv\string  $record_offset_attribute_name) 

HTML tr record offset attribute setter.

Parameters

\League\Csv\string $record_offset_attribute_name

td()

td(\League\Csv\string  $fieldname_attribute_name) 

HTML td field name attribute setter.

Parameters

\League\Csv\string $fieldname_attribute_name

appendHeaderSection()

appendHeaderSection(\League\Csv\string  $node_name, array  $record, \DOMElement  $table) 

Creates a DOMElement representing a HTML table heading section.

Parameters

\League\Csv\string $node_name
array $record
\DOMElement $table

addHTMLAttributes()

addHTMLAttributes(\DOMElement  $node) 

Adds class and id attributes to an HTML tag.

Parameters

\DOMElement $node