class TableHelper extends Helper

deprecated since version 2.5, to be removed in 3.0 Use {@link Table} instead.

Provides helpers to display table output.

Constants

LAYOUT_DEFAULT

LAYOUT_BORDERLESS

LAYOUT_COMPACT

Methods

setHelperSet(HelperSet $helperSet = null)

Sets the helper set associated with this helper.

from Helper
getHelperSet()

Gets the helper set associated with this helper.

from Helper
static int
strlen(string $string)

Returns the length of a string, using mb_strwidth if it is available.

from Helper
static 
formatTime($secs)

No description

from Helper
static 
formatMemory($memory)

No description

from Helper
static 
strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)

No description

from Helper
__construct($triggerDeprecationError = true)

No description

setLayout(int $layout)

Sets table layout type.

setHeaders(array $headers)

No description

setRows(array $rows)

No description

addRows(array $rows)

No description

addRow(array $row)

No description

setRow($column, array $row)

No description

setPaddingChar(string $paddingChar)

Sets padding character, used for cell padding.

setHorizontalBorderChar(string $horizontalBorderChar)

Sets horizontal border character.

setVerticalBorderChar(string $verticalBorderChar)

Sets vertical border character.

setCrossingChar(string $crossingChar)

Sets crossing character.

setCellHeaderFormat(string $cellHeaderFormat)

Sets header cell format.

setCellRowFormat(string $cellRowFormat)

Sets row cell format.

setCellRowContentFormat(string $cellRowContentFormat)

Sets row cell content format.

setBorderFormat(string $borderFormat)

Sets table border format.

setPadType(int $padType)

Sets cell padding type.

render(OutputInterface $output)

Renders table to output.

string
getName()

Returns the canonical name of this helper.

Details

in Helper at line line 30
setHelperSet(HelperSet $helperSet = null)

Sets the helper set associated with this helper.

Parameters

HelperSet $helperSet A HelperSet instance

in Helper at line line 40
HelperSet getHelperSet()

Gets the helper set associated with this helper.

Return Value

HelperSet A HelperSet instance

in Helper at line line 52
static int strlen(string $string)

Returns the length of a string, using mb_strwidth if it is available.

Parameters

string $string The string to check its length

Return Value

int The length of the string

in Helper at line line 61
static formatTime($secs)

Parameters

$secs

in Helper at line line 88
static formatMemory($memory)

Parameters

$memory

in Helper at line line 105
static strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)

Parameters

OutputFormatterInterface $formatter
$string

at line line 38
__construct($triggerDeprecationError = true)

Parameters

$triggerDeprecationError

at line line 56
TableHelper setLayout(int $layout)

Sets table layout type.

Parameters

int $layout self::LAYOUT_*

Return Value

TableHelper

Exceptions

InvalidArgumentException when the table layout is not known

at line line 78
setHeaders(array $headers)

Parameters

array $headers

at line line 85
setRows(array $rows)

Parameters

array $rows

at line line 92
addRows(array $rows)

Parameters

array $rows

at line line 99
addRow(array $row)

Parameters

array $row

at line line 106
setRow($column, array $row)

Parameters

$column
array $row

at line line 120
TableHelper setPaddingChar(string $paddingChar)

Sets padding character, used for cell padding.

Parameters

string $paddingChar

Return Value

TableHelper

at line line 134
TableHelper setHorizontalBorderChar(string $horizontalBorderChar)

Sets horizontal border character.

Parameters

string $horizontalBorderChar

Return Value

TableHelper

at line line 148
TableHelper setVerticalBorderChar(string $verticalBorderChar)

Sets vertical border character.

Parameters

string $verticalBorderChar

Return Value

TableHelper

at line line 162
TableHelper setCrossingChar(string $crossingChar)

Sets crossing character.

Parameters

string $crossingChar

Return Value

TableHelper

at line line 176
TableHelper setCellHeaderFormat(string $cellHeaderFormat)

Sets header cell format.

Parameters

string $cellHeaderFormat

Return Value

TableHelper

at line line 190
TableHelper setCellRowFormat(string $cellRowFormat)

Sets row cell format.

Parameters

string $cellRowFormat

Return Value

TableHelper

at line line 204
TableHelper setCellRowContentFormat(string $cellRowContentFormat)

Sets row cell content format.

Parameters

string $cellRowContentFormat

Return Value

TableHelper

at line line 218
TableHelper setBorderFormat(string $borderFormat)

Sets table border format.

Parameters

string $borderFormat

Return Value

TableHelper

at line line 232
TableHelper setPadType(int $padType)

Sets cell padding type.

Parameters

int $padType STRPAD*

Return Value

TableHelper

at line line 253
render(OutputInterface $output)

Renders table to output.

Example: +---------------+-----------------------+------------------+ | ISBN | Title | Author | +---------------+-----------------------+------------------+ | 99921-58-10-7 | Divine Comedy | Dante Alighieri | | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | +---------------+-----------------------+------------------+

Parameters

OutputInterface $output

at line line 265
string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name