PHP Class Webmozart\Console\UI\Component\LabeledParagraph
The paragraph is indented to the right of the label and wrapped into the
dimensions of the output. You can align multiple labeled paragraphs by
passing a {@link LabelAlignment} to {@link setAlignment()}.
Mostra file
Open project: webmozart/console
Class Usage Examples
Public Methods
Method Details
__construct()
public method
Creates a new labeled paragraph.
public __construct ( string $label, string $text, integer $padding = 2, boolean $aligned = true ) |
$label |
string |
The label. |
$text |
string |
The text. |
$padding |
integer |
The padding between the text and label in number
of spaces. |
$aligned |
boolean |
Whether the paragraph should be aligned with the
other paragraph in its alignment (if one is set). |
getPadding()
public method
Returns the padding between the label and the text in number of spaces.
isAligned()
public method
Returns whether the paragraph is aligned with other paragraphs in its
alignment.
public isAligned ( ) : boolean |
return |
boolean |
Returns `true` if the paragraph should be aligned with the
other paragraphs in the alignment and `false` otherwise. |
public render ( IO $io, integer $indentation ) |
$io |
Webmozart\Console\Api\IO\IO |
The I/O. |
$indentation |
integer |
The number of spaces to indent. |
setAlignment()
public method
Sets the alignment used to align the paragraph.
public setAlignment ( LabelAlignment $alignment ) |
$alignment |
Webmozart\Console\UI\Alignment\LabelAlignment |
The alignment. |