PHP 클래스 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()}.
부터: 1.0
저자: Bernhard Schussek ([email protected])
상속: implements Webmozart\Console\UI\Component
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $label, string $text, integer $padding = 2, boolean $aligned = true ) Creates a new labeled paragraph.
getLabel ( ) : string Returns the label.
getPadding ( ) : integer Returns the padding between the label and the text in number of spaces.
getText ( ) : string Returns the text.
isAligned ( ) : boolean Returns whether the paragraph is aligned with other paragraphs in its alignment.
render ( IO $io, integer $indentation ) Renders the paragraph.
setAlignment ( LabelAlignment $alignment ) Sets the alignment used to align the paragraph.

메소드 상세

__construct() 공개 메소드

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() 공개 메소드

Returns the label.
public getLabel ( ) : string
리턴 string The label.

getPadding() 공개 메소드

Returns the padding between the label and the text in number of spaces.
public getPadding ( ) : integer
리턴 integer The number of spaces between the label and the text.

getText() 공개 메소드

Returns the text.
public getText ( ) : string
리턴 string The text.

isAligned() 공개 메소드

Returns whether the paragraph is aligned with other paragraphs in its alignment.
public isAligned ( ) : boolean
리턴 boolean Returns `true` if the paragraph should be aligned with the other paragraphs in the alignment and `false` otherwise.

render() 공개 메소드

Renders the paragraph.
public render ( IO $io, integer $indentation )
$io Webmozart\Console\Api\IO\IO The I/O.
$indentation integer The number of spaces to indent.

setAlignment() 공개 메소드

Sets the alignment used to align the paragraph.
public setAlignment ( LabelAlignment $alignment )
$alignment Webmozart\Console\UI\Alignment\LabelAlignment The alignment.