Documentation

TwoColumn extends Format
in package
Uses ParamOpts

A layout using two columns.

Columns:

| Parameter name and value if any | Description of parameter |

Example:

-a Toggle short parameter toggle_desc here. -b Valued short parameter value_desc here. -c Optional short parameter toggle_desc here. -c= Optional short parameter value_desc here. --long1 Toggle long parameter toggle_desc here. --long2 Valued long parameter value_desc here. --long3 Optional long parameter toggle_desc here. --long3=<long_value> Optional long parameter value_desc here.

Table of Contents

OPT_ALIASES  = ["minCol" => "min_col_width", "maxCol" => "max_col_width"]
OPT_EXCEPTIONS  = ['params', 'group', 'col_widths']
RESERVED_WIDTH  = 4
$col_widths  : mixed
$group  : mixed
$max_col_width  : mixed
$min_col_width  : mixed
$params  : mixed
__construct()  : mixed
Build a new formatting plugin.
render()  : string
A method to actually render the ParamGroup.
update_layout()  : mixed
A method to update the layout when a Param is added.
__construct_opts()  : mixed
Set instance properties based on an array of options.
initialize_layout()  : mixed
A method to set up the default layout.

Constants

OPT_ALIASES

public mixed OPT_ALIASES = ["minCol" => "min_col_width", "maxCol" => "max_col_width"]

OPT_EXCEPTIONS

public mixed OPT_EXCEPTIONS = ['params', 'group', 'col_widths']

RESERVED_WIDTH

public mixed RESERVED_WIDTH = 4

Properties

$col_widths

protected mixed $col_widths = []

$max_col_width

protected mixed $max_col_width = 40

$min_col_width

protected mixed $min_col_width = 4

Methods

__construct()

Build a new formatting plugin.

public __construct(Params $params, ParamGroup $group[, array<string|int, mixed> $opts = [] ]) : mixed
Parameters
$params : Params

The Params object at the top of the hiearchy.

$group : ParamGroup

The ParamGroup this is being used by.

$opts : array<string|int, mixed> = []

(Optional) Any extra plugin-specific options.

Return values
mixed

render()

A method to actually render the ParamGroup.

public render() : string
Return values
string

The rendered output representing the group help text.

update_layout()

A method to update the layout when a Param is added.

public update_layout(Param $param) : mixed
Parameters
$param : Param

The Param object being added.

Return values
mixed

__construct_opts()

Set instance properties based on an array of options.

protected __construct_opts(array<string|int, mixed> $opts[, array<string|int, mixed> $exceptions = [] ][, array<string|int, mixed> $aliases = [] ]) : mixed
Parameters
$opts : array<string|int, mixed>

The associative array of options passed.

$exceptions : array<string|int, mixed> = []

A flat array of property/option names to skip.

$aliases : array<string|int, mixed> = []

An associative array of "alias" => "property".

Return values
mixed

initialize_layout()

A method to set up the default layout.

protected initialize_layout(mixed $opts) : mixed
Parameters
$opts : mixed

The $opts passed to the constructor.

Return values
mixed

Search results