Overview

Namespaces

  • Webmozart
    • Console
      • Adapter
      • Api
        • Application
        • Args
          • Format
        • Command
        • Config
        • Event
        • Formatter
        • IO
        • Resolver
      • Args
      • Config
      • Formatter
      • Handler
        • Help
      • IO
        • InputStream
        • OutputStream
      • Process
      • Resolver
      • UI
        • Alignment
        • Component
        • Help
        • Layout
        • Style
      • Util

Classes

  • BorderUtil
  • CellWrapper
  • EmptyLine
  • ExceptionTrace
  • Grid
  • LabeledParagraph
  • NameVersion
  • Paragraph
  • Table
  • Overview
  • Namespace
  • Class

Class LabeledParagraph

A paragraph with a label on its left.

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 Webmozart\Console\UI\Alignment\LabelAlignment to Webmozart\Console\UI\Component\LabeledParagraph::setAlignment().

Webmozart\Console\UI\Component\LabeledParagraph implements Webmozart\Console\UI\Component
Namespace: Webmozart\Console\UI\Component
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
Located at UI/Component/LabeledParagraph.php
Methods summary
public
# __construct( string $label, string $text, integer $padding = 2, boolean $aligned = true )

Creates a new labeled paragraph.

Creates a new labeled paragraph.

Parameters

$label
The label.
$text
The text.
$padding

The padding between the text and label in number of spaces.

$aligned

Whether the paragraph should be aligned with the other paragraph in its alignment (if one is set).

public string
# getLabel( )

Returns the label.

Returns the label.

Returns

string
The label.
public string
# getText( )

Returns the text.

Returns the text.

Returns

string
The text.
public integer
# getPadding( )

Returns the padding between the label and the text in number of spaces.

Returns the padding between the label and the text in number of spaces.

Returns

integer
The number of spaces between the label and the text.
public
# setAlignment( Webmozart\Console\UI\Alignment\LabelAlignment $alignment )

Sets the alignment used to align the paragraph.

Sets the alignment used to align the paragraph.

Parameters

$alignment
The alignment.
public boolean
# isAligned( )

Returns whether the paragraph is aligned with other paragraphs in its alignment.

Returns whether the paragraph is aligned with other paragraphs in its alignment.

Returns

boolean

Returns true if the paragraph should be aligned with the other paragraphs in the alignment and false otherwise.

public
# render( Webmozart\Console\Api\IO\IO $io, integer $indentation = 0 )

Renders the paragraph.

Renders the paragraph.

Parameters

$io
The I/O.
$indentation
The number of spaces to indent.

Implementation of

Webmozart\Console\UI\Component::render()
Webmozart Console API API documentation generated by ApiGen