TableFormatter
class TableFormatter implements FormatterInterface, ValidDataTypesInterface, RenderDataInterface, MetadataFormatterInterface, HumanReadableFormat (View source)
Display a table of data with the Symfony Table class.
This formatter takes data of either the RowsOfFields or PropertyList data type. Tables can be rendered with the rows running either vertically (the normal orientation) or horizontally. By default, associative lists will be displayed as two columns, with the key in the first column and the value in the second column.
Traits
Provides a default implementation of isValidDataType.
Properties
protected | $fieldLabels | ||
protected | $defaultFields |
Methods
Return the list of data types acceptable to this formatter
Return the list of data types acceptable to this formatter
No description
No description
Add our custom table style(s) to the table.
Details
ReflectionClass[]
validDataTypes()
Return the list of data types acceptable to this formatter
isValidDataType(ReflectionClass $dataType)
Return the list of data types acceptable to this formatter
renderData($originalData, $restructuredData, FormatterOptions $options)
No description
protected
renderEachCell($originalData, $restructuredData, FormatterOptions $options)
No description
writeMetadata(OutputInterface $output, $structuredOutput, FormatterOptions $options)
No description
__construct()
No description
mixed
validate(mixed $structuredData)
No description
write(OutputInterface $output, $tableTransformer, FormatterOptions $options)
No description
protected array
wrap($headers, array $data, TableStyle $tableStyle, FormatterOptions $options)
Wrap the table data
static protected
addCustomTableStyles($table)
Add our custom table style(s) to the table.