Class TableShellHelper
Create a visually pleasing ASCII art table from 2 dimensional array data.
- BaseShellHelper
- TableShellHelper
Copyright:
Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/Helper/TableShellHelper.php
License: MIT License
Location: Cake/Console/Helper/TableShellHelper.php
Properties summary
-
$_defaultConfig
protectedarray
Default config for this helper.
Inherited Properties
Method Summary
-
_addStyle() protected
Add style tags -
_calculateWidths() protected
Calculate the column widths -
_render() protected
Output a row. -
_rowSeparator() protected
Output a row separator. -
output() public
Output a table.
Method Detail
_addStyle() protected ¶
_addStyle( string $text , string $style )
Add style tags
Parameters
- string $text
- The text to be surrounded
- string $style
- The style to be applied
Returns
string
_calculateWidths() protected ¶
_calculateWidths( array $rows )
Calculate the column widths
Parameters
- array $rows
- The rows on which the columns width will be calculated on.
Returns
array
_render() protected ¶
_render( array $row , array $widths , array $options = array() )
Output a row.
Parameters
- array $row
- The row to output.
- array $widths
- The widths of each column to output.
- array $options optional array()
- Options to be passed.
_rowSeparator() protected ¶
_rowSeparator( array $widths )
Output a row separator.
Parameters
- array $widths
- The widths of each column to output.
Methods inherited from BaseShellHelper
__construct() public ¶
__construct( ConsoleOutput
$consoleOutput , array $config = array() )
Constructor.
Parameters
-
ConsoleOutput
$consoleOutput - The ConsoleOutput instance to use.
- array $config optional array()
- The settings for this helper.
Properties detail
$_defaultConfig ¶
protected
array
Default config for this helper.
array( 'headers' => true, 'rowSeparator' => false, 'headerStyle' => 'info', )