function AttributeString::__toString

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Template/AttributeString.php \Drupal\Core\Template\AttributeString::__toString()
  2. 8.9.x core/lib/Drupal/Core/Template/AttributeString.php \Drupal\Core\Template\AttributeString::__toString()
  3. 10 core/lib/Drupal/Core/Template/AttributeString.php \Drupal\Core\Template\AttributeString::__toString()

Implements the magic __toString() method.

Overrides AttributeValueBase::__toString

File

core/lib/Drupal/Core/Template/AttributeString.php, line 27

Class

AttributeString
A class that represents most standard HTML attributes.

Namespace

Drupal\Core\Template

Code

public function __toString() {
    return Html::escape((string) $this->value);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.