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()}.
Afficher le fichier
Open project: webmozart/console
Class Usage Examples
Méthodes publiques
Method Details
__construct()
public méthode
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). |
getLabel()
public méthode
getPadding()
public méthode
Returns the padding between the label and the text in number of spaces.
isAligned()
public méthode
Returns whether the paragraph is aligned with other paragraphs in its
alignment.
public isAligned ( ) : boolean |
Résultat |
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 méthode
Sets the alignment used to align the paragraph.
public setAlignment ( LabelAlignment $alignment ) |
$alignment |
Webmozart\Console\UI\Alignment\LabelAlignment |
The alignment. |