public function AttributeValueBase::render

Returns a string representation of the attribute.

While __toString only returns the value in a string form, render() contains the name of the attribute as well.

Return value

string The string representation of the attribute.

1 method overrides AttributeValueBase::render()
AttributeBoolean::render in drupal/core/lib/Drupal/Core/Template/AttributeBoolean.php
Overrides AttributeValueBase::render().

File

drupal/core/lib/Drupal/Core/Template/AttributeValueBase.php, line 55
Definition of Drupal\Core\Template\AttributeValueBase.

Class

AttributeValueBase
Defines the base class for an attribute type.

Namespace

Drupal\Core\Template

Code

public function render() {
  return $this->name . '="' . $this . '"';
}