Zend\Text\Table\Table
Zend\Text\Table\Table enables developers to create tables out of characters
Synopsis
class Table
{
- // constants
- const AUTO_SEPARATE_NONE = 0x0;
- const AUTO_SEPARATE_HEADER = 0x1;
- const AUTO_SEPARATE_FOOTER = 0x2;
- const AUTO_SEPARATE_ALL = 0x4;
- // members
- protected DecoratorInterface $decorator;
- protected array $columnWidths;
- protected array $rows;
- protected int $autoSeparate;
- protected integer $padding;
- protected array $defaultColumnAligns;
- protected DecoratorManager $decoratorManager;
- protected string $inputCharset;
- protected string $outputCharset;
- protected array $skipOptions;
- // methods
- public void __construct()
- public Table setOptions()
- public Table setColumnWidths()
- public Table setAutoSeparate()
- public Table setDecorator()
- public Table setPadding()
- public DecoratorManager getDecoratorManager()
- public Table setDecoratorManager()
- public Table setDefaultColumnAlign()
- public static void setInputCharset()
- public static string getInputCharset()
- public static void setOutputCharset()
- public static string getOutputCharset()
- public Table appendRow()
- public string render()
- public string __toString()
Constants
Name | Value |
---|---|
AUTO_SEPARATE_NONE | 0x0 |
AUTO_SEPARATE_HEADER | 0x1 |
AUTO_SEPARATE_FOOTER | 0x2 |
AUTO_SEPARATE_ALL | 0x4 |
Members
protected
- $autoSeparate
—
int
Auto separation mode - $columnWidths
—
array
List of all column widths - $decorator
—
Zend\Text\Table\Decorator\DecoratorInterface
Decorator used for the table borders - $decoratorManager
—
Zend\Text\Table\DecoratorManager
Plugin loader for decorators - $defaultColumnAligns
—
array
Default column aligns for rows created by appendRow(array $data) - $inputCharset
—
string
Charset which is used for input by default - $outputCharset
—
string
Charset which is used internally - $padding
—
int
Padding for columns - $rows
—
array
Rows of the table - $skipOptions
—
array
Option keys to skip when calling setOptions()
Methods
public
- __construct() — Create a basic table object
- __toString() — Magic method which returns the rendered table
- appendRow() — Append a row to the table
- getDecoratorManager() — Get the plugin manager for decorators
- getInputCharset() — Get the input charset for column contents
- getOutputCharset() — Get the output charset for column contents
- render() — Render the table
- setAutoSeparate() — Set auto separation mode
- setColumnWidths() — Set column widths
- setDecorator() — Set decorator
- setDecoratorManager() — Set the plugin manager instance for decorators
- setDefaultColumnAlign() — Set default column align for rows created by appendRow(array $data)
- setInputCharset() — Set the input charset for column contents
- setOptions() — Set options from array
- setOutputCharset() — Set the output charset for column contents
- setPadding() — Set the column padding