Text (also body in journalism jargon) is a sequence of subheads, paragraphs and images.
$textElement = new Text( string $text [, array $params ] );
or
$textElement = Text::from( array|object $data [, array $mapping [, array $params ] ] );
data
must contain values for the required constructor argument text
.
Property | Type | Description | Required |
---|---|---|---|
text | string | The text | yes |
Get the text.
$text = $textElement->get( 'text' );
Parameters are optional settings for the presentation. All elements can have 'id' and 'class' parameters; other depend on environment and/or renderer.
Parameter | Type | Description |
---|---|---|
id | string | The ID of the element |
class | string | CSS class |
Get an associative array with all parameters.
$params = $textElement->getParameters();
Retrieve a single parameter. Default should be provided.
$id = $textElement->getParameter( 'id' [, $default ] );
$class = $textElement->getParameter( 'class' [, $default ] );