Overview

Namespaces

  • None
  • splitbrain
    • phpcli
      • tests

Classes

  • Options
  • OptionsTest
  • TableFormatter
  • TableFormatterTest
  • Overview
  • Namespace
  • Class

Class TableFormatter

Class TableFormatter

Output text in multiple columns

splitbrain\phpcli\TableFormatter
Extended by splitbrain\phpcli\tests\TableFormatter
Namespace: splitbrain\phpcli\tests
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at tests/TableFormatterTest.php
Methods summary
public int[]
# calculateColLengths( array $columns )

Takes an array with dynamic column width and calculates the correct width

Takes an array with dynamic column width and calculates the correct width

Column width can be given as fixed char widths, percentages and a single * width can be given for taking the remaining available space. When mixing percentages and fixed widths, percentages refer to the remaining space after allocating the fixed width

Parameters

$columns

Returns

int[]

Throws

Exception

Overrides

splitbrain\phpcli\TableFormatter::calculateColLengths()
public integer
# strlen( $string )

Measures char length in UTF-8 when possible

Measures char length in UTF-8 when possible

Parameters

$string

Returns

integer

Overrides

splitbrain\phpcli\TableFormatter::strlen()
public string
# wordwrap( string $str, integer $width = 75, string $break = "\n", boolean $cut = false )

Parameters

$str
$width
$break
$cut

Returns

string

Link

http://stackoverflow.com/a/4988494

Overrides

splitbrain\phpcli\TableFormatter::wordwrap()
Methods inherited from splitbrain\phpcli\TableFormatter
__construct(), format(), getBorder(), getMaxWidth(), getTerminalWidth(), pad(), setBorder(), setMaxWidth(), substr()
Properties inherited from splitbrain\phpcli\TableFormatter
$border, $colors, $max
API documentation generated by ApiGen