Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 1.28 KB

Text.md

File metadata and controls

65 lines (41 loc) · 1.28 KB

◄ Back to index

Text icon Joomla\Content\Element\Text

Text (also body in journalism jargon) is a sequence of subheads, paragraphs and images.

Usage

$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.

Properties

Property Type Description Required
text string The text yes

Text

Get the text.

$text = $textElement->get( 'text' );

Parameters

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

Parameter List

Get an associative array with all parameters.

$params = $textElement->getParameters();

Single Parameter

Retrieve a single parameter. Default should be provided.

$id    = $textElement->getParameter( 'id' [, $default ] );
$class = $textElement->getParameter( 'class' [, $default ] );

Examples