public function TagElement::__construct in Extensible BBCode 4.0.x
Same name and namespace in other branches
- 8.3 src/Parser/Tree/TagElement.php \Drupal\xbbcode\Parser\Tree\TagElement::__construct()
TagElement constructor.
Parameters
string $opening: The opening tag name.
string $argument: The argument (everything past the tag name)
string $source: The source of the content.
File
- src/
Parser/ Tree/ TagElement.php, line 86
Class
- TagElement
- A BBCode tag element.
Namespace
Drupal\xbbcode\Parser\TreeCode
public function __construct(string $opening, string $argument, string $source) {
$this->name = mb_strtolower($opening);
$this->openingName = $opening;
$this->argument = $argument;
$this->source = $source;
if ($argument && $argument[0] === '=') {
$this->option = XBBCodeParser::parseOption($argument);
}
else {
$this->attributes = XBBCodeParser::parseAttributes($argument);
}
}