You are here

public function TagElement::__construct in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/Parser/Tree/TagElement.php \Drupal\xbbcode\Parser\Tree\TagElement::__construct()

TagElement constructor.

Parameters

string $name: The 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 73

Class

TagElement
A BBCode tag element.

Namespace

Drupal\xbbcode\Parser\Tree

Code

public function __construct($name, $argument, $source) {
  $this->name = $name;
  $this->argument = $argument;
  $this->source = $source;
  if ($argument && $argument[0] === '=') {
    $this->option = XBBCodeParser::parseOption($argument);
  }
  else {
    $this->attributes = XBBCodeParser::parseAttributes($argument);
  }
}