You are here

public function TagElement::getAttribute in Extensible BBCode 4.0.x

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

Retrieve a particular attribute of the element.

[tag NAME=VALUE]...[/tag]

Parameters

string $name: The name of the attribute, or NULL.

Return value

string|null The value of this attribute, or NULL if it isn't set.

Overrides TagElementInterface::getAttribute

File

src/Parser/Tree/TagElement.php, line 139

Class

TagElement
A BBCode tag element.

Namespace

Drupal\xbbcode\Parser\Tree

Code

public function getAttribute(string $name) : ?string {
  return $this->attributes[$name] ?? NULL;
}