function FieldPluginBase::elementLabelClasses

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::elementLabelClasses()
  2. 8.9.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::elementLabelClasses()
  3. 10 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::elementLabelClasses()

Overrides FieldHandlerInterface::elementLabelClasses

File

core/modules/views/src/Plugin/views/field/FieldPluginBase.php, line 403

Class

FieldPluginBase
Base class for views fields.

Namespace

Drupal\views\Plugin\views\field

Code

public function elementLabelClasses($row_index = NULL) {
    $classes = $this->tokenizeValue($this->options['element_label_class'], $row_index);
    $classes = explode(' ', $classes);
    foreach ($classes as &$class) {
        $class = Html::cleanCssIdentifier($class);
    }
    return implode(' ', $classes);
}

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