Skip to content

Latest commit

 

History

History
59 lines (51 loc) · 6.16 KB

Documentation.md

File metadata and controls

59 lines (51 loc) · 6.16 KB

Table of contents


Class: \jc21\CliTable

Visibility Function
public __construct(string $itemName='Row', bool $useColors=true) : void
Constructor
public addField(string $fieldName, string $fieldKey, bool/bool/object $manipulator=false, string $color='reset') : void
addField
public display() : void
display
public get() : string
get
public getHeaderColor() : string
getHeaderColor
public getItemName() : string
getItemName
public getShowHeaders() : bool
getShowHeaders
public getTableColor() : string
getTableColor
public getUseColors() : bool
getUseColors
public injectData(array $data) : void
injectData
public setChars(array $chars) : void
setChars
public setHeaderColor(string $color) : void
setHeaderColor
public setItemName(string $name) : void
setItemName
public setShowHeaders(bool $bool) : void
setShowHeaders
public setTableColor(string $color) : void
setTableColor
public setUseColors(bool $bool) : void
setUseColors
protected defineColors() : void
defineColors
protected getChar(string $type, mixed/int $length=1) : string
getChar
protected getColorFromName(string $colorName) : string
getColorFromName
protected getFormattedRow(array $rowData, array $columnLengths, bool $header=false) : string
getFormattedRow
protected getPluralItemName() : string
getPluralItemName
protected getTableBottom(array $columnLengths) : string
getTableBottom
protected getTableSeperator(array $columnLengths) : string
getTableSeperator
protected getTableTop(array $columnLengths) : string
getTableTop

Class: \jc21\CliTableManipulator

Visibility Function
public __construct(string $type) : void
Constructor
public manipulate(mixed $value, array $row=array(), string $fieldName='') : string
manipulate This is used by the Table class to manipulate the data passed in and returns the formatted data.
protected date(mixed $value) : string
date Changes 1372132121 to 25-06-2013
protected datelong(mixed $value) : string
datelong Changes 1372132121 to 25th June 2013
protected datetime(mixed $value) : string
datetime Changes 1372132121 to 25th June 2013, 1:48 pm
protected dollar(mixed $value) : string
dollar Changes 12300.23 to $12,300.23
protected duetime(mixed $value) : string
duetime
protected month(mixed $value) : string
month Changes 1372132121 to June
protected monthyear(mixed $value) : string
monthyear Changes 1372132121 to June 2013
protected nicenumber(int $value) : string
nicenumber
protected nicetime(mixed $value) : string
nicetime Changes 1372132121 to 25th June 2013, 1:48 pm Changes 1372132121 to Today, 1:48 pm Changes 1372132121 to Yesterday, 1:48 pm
protected percent(mixed $value) : string
percent Changes 50.2 to 50%
protected text(mixed $value) : string
text Strips input of any html
protected time(mixed $value) : string
time Changes 1372132121 to 1:48 pm
protected year(mixed $value) : string
year Changes 1372132121 to 2013
protected yesno(mixed $value) : string
yesno Changes 0/false and 1/true to No and Yes respectively