You are here

public static function Blazy::getHtmlId in Blazy 8

Same name and namespace in other branches
  1. 8.2 src/Blazy.php \Drupal\blazy\Blazy::getHtmlId()
  2. 7 src/Blazy.php \Drupal\blazy\Blazy::getHtmlId()

Returns the trusted HTML ID of a single instance.

3 calls to Blazy::getHtmlId()
BlazyFormatterManager::buildSettings in src/BlazyFormatterManager.php
Returns the field formatter settings inherited by child elements.
BlazyManagerBase::getCacheMetadata in src/BlazyManagerBase.php
Return the cache metadata common for all blazy-related modules.
BlazyStyleBaseTrait::buildSettings in src/Dejavu/BlazyStyleBaseTrait.php
Provides commons settings for the style plugins.

File

src/Blazy.php, line 489

Class

Blazy
Implements BlazyInterface.

Namespace

Drupal\blazy

Code

public static function getHtmlId($string = 'blazy', $id = '') {
  if (!isset(static::$blazyId)) {
    static::$blazyId = 0;
  }

  // Do not use dynamic Html::getUniqueId, otherwise broken AJAX.
  return empty($id) ? Html::getId($string . '-' . ++static::$blazyId) : strip_tags($id);
}