class TextElement in Extensible BBCode 8.3
Same name and namespace in other branches
- 4.0.x src/Parser/Tree/TextElement.php \Drupal\xbbcode\Parser\Tree\TextElement
An element representing a text fragment.
Hierarchy
- class \Drupal\xbbcode\Parser\Tree\TextElement implements ElementInterface
Expanded class hierarchy of TextElement
3 files declare their use of TextElement
- TreeEncodeTrait.php in standard/
src/ TreeEncodeTrait.php - XBBCodeFilter.php in src/
Plugin/ Filter/ XBBCodeFilter.php - XBBCodeParser.php in src/
Parser/ XBBCodeParser.php
File
- src/
Parser/ Tree/ TextElement.php, line 8
Namespace
Drupal\xbbcode\Parser\TreeView source
class TextElement implements ElementInterface {
/**
* The text.
*
* @var string
*/
protected $text;
/**
* TextElement constructor.
*
* @param string $text
* The text.
*/
public function __construct($text) {
$this
->setText($text);
}
/**
* Get the text.
*
* @return string
* The text.
*/
public function getText() : string {
return $this->text;
}
/**
* Set the text.
*
* @param string $text
* The text.
*
* @return $this
*/
public function setText($text) : self {
$this->text = $text;
return $this;
}
/**
* {@inheritdoc}
*/
public function render() : string {
return $this
->getText();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TextElement:: |
protected | property | The text. | |
TextElement:: |
public | function | Get the text. | |
TextElement:: |
public | function |
Render this element to a string. Overrides ElementInterface:: |
|
TextElement:: |
public | function | Set the text. | |
TextElement:: |
public | function | TextElement constructor. |