Documentation

CliOutputController extends OutputController

Output controller for cli output

Tags
copyright

Cloudrexx AG

author

Michael Ritter michael.ritter@cloudrexx.com

subpackage

core_modules_dataaccess

Table of Contents

Constants

AFTER_VALUE  = ' '
BEFORE_VALUE  = ' '
BOTTOM  = '-'
BOTTOM_CORNER  = '+'
BOTTOM_LEFT_CORNER  = '+'
BOTTOM_RIGHT_CORNER  = '+'
LEFT  = '|'
LEFT_CORNER  = '+'
LINE_END  = "\n"
MIDDLE_CORNER  = '+'
MIDDLE_HORIZONTAL  = '-'
MIDDLE_VERTICAL  = '|'
PAD  = ' '
RIGHT  = '|'
RIGHT_CORNER  = '+'
TOP  = '-'
TOP_CORNER  = '+'
TOP_LEFT_CORNER  = '+'
TOP_RIGHT_CORNER  = '+'

Properties

$cx  : Cx
Main class instance

Methods

__call()  : mixed
Route methods like getName(), getType(), getDirectory(), etc.
__construct()  : mixed
Creates new controller
getSystemComponentController()  : SystemComponentController
Returns the main controller
parse()  : string
Returns the cli encoded (/unencoded) data
array_depth()  : int
Detects the depth of an array
createTableBorderLine()  : string
Creates one of the border lines (those without data)
createTableDataLine()  : string
Creates one of the data lines
createTableLine()  : mixed
Creates a table line using the supplied signs
tablify()  : string
Creates a human readable table with ASCII art

Constants

Properties

Methods

__call()

Route methods like getName(), getType(), getDirectory(), etc.

public __call(string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
$methodName : string

Name of method to call

$arguments : array<string|int, mixed>

List of arguments for the method to call

Attributes
#[ReturnTypeWillChange]
Return values
mixed

Return value of the method to call

parse()

Returns the cli encoded (/unencoded) data

public parse(array<string|int, mixed> $data) : string
Parameters
$data : array<string|int, mixed>

Data to encode

Return values
string

Encoded data

array_depth()

Detects the depth of an array

protected array_depth(array<string|int, mixed> $array) : int
Parameters
$array : array<string|int, mixed>

Array to analyze

Return values
int

Depth of $array

createTableBorderLine()

Creates one of the border lines (those without data)

protected createTableBorderLine(array<string|int, mixed> $fieldLength, string $position) : string
Parameters
$fieldLength : array<string|int, mixed>

List of the size of the longest values for each attribute

$position : string

Either 'top', 'middle' or 'bottom'

Return values
string

One table line without data

createTableDataLine()

Creates one of the data lines

protected createTableDataLine(array<string|int, mixed> $fieldLength, array<string|int, mixed> $data) : string
Parameters
$fieldLength : array<string|int, mixed>

List of the size of the longest values for each attribute

$data : array<string|int, mixed>

Data for this row

Return values
string

One table line with data

createTableLine()

Creates a table line using the supplied signs

protected createTableLine(string $begin, string $beforeValue, string $filler, string $afterValue, string $corner, string $end, mixed $lengths, array<string|int, mixed> $data) : mixed
Parameters
$begin : string

Character to begin the line with (must be of same length for each row!)

$beforeValue : string

Character to insert before value (must be of same length for each row!)

$filler : string

Padding character for smaller values (must be just one character!)

$afterValue : string

Character to insert after value (must be of same length for each row!)

$corner : string

Character to separate values (must be of same length for each row!)

$end : string

Character to end the line with (must be of same length for each row!)

$lengths : mixed
$data : array<string|int, mixed>

Data for this row

tablify()

Creates a human readable table with ASCII art

protected tablify(mixed $table) : string
Parameters
$table : mixed
Tags
todo

add option to break long lines after some chars

Return values
string

ASCII art table


        
On this page

Search results