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
protectedDefault config for this helper.array
Inherited Properties
Method Summary
- _addStyle() protectedAdd style tags
- _calculateWidths() protectedCalculate the column widths
- _render() protectedOutput a row.
- _rowSeparator() protectedOutput a row separator.
- output() publicOutput a table.
Method Detail
_addStyle()source 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()source 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()source 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()source protected
_rowSeparator( array $widths )
Output a row separator.
Parameters
- array
$widths
- The widths of each column to output.
output()source public
output( array $rows )
Output a table.
Parameters
- array
$rows
- The data to render out.
Methods inherited from BaseShellHelper
__construct()source 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.
config()source public
config( null $config null )
Initialize config & store config values
Parameters
- null
$config
optional null - Config values to set
Returns
array|Properties detail
$_defaultConfigsource
protected array
Default config for this helper.
array( 'headers' => true, 'rowSeparator' => false, 'headerStyle' => 'info', )
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/2.10/class-TableShellHelper.html