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
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
= []
$group
protected
mixed
$group
$max_col_width
protected
mixed
$max_col_width
= 40
$min_col_width
protected
mixed
$min_col_width
= 4
$params
protected
mixed
$params
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.