plus-8.x-4.x-dev/src/Utility/AttributeString.php

src/Utility/AttributeString.php
<?php

namespace Drupal\plus\Utility;

use Drupal\Component\Utility\Html;

/**
 * A class that represents most standard HTML attributes.
 *
 * To use with the Attribute class, set the key to be the attribute name
 * and the value the attribute value.
 * @code
 *  $attributes = new Attribute(array());
 *  $attributes['id'] = 'socks';
 *  $attributes['style'] = 'background-color:white';
 *  echo '<cat ' . $attributes . '>';
 *  // Produces: <cat id="socks" style="background-color:white">.
 * @endcode
 *
 * @see \Drupal\Core\Template\Attribute
 */
class AttributeString extends AttributeBase {

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

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc