function FieldPluginBase::elementClasses

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

Overrides FieldHandlerInterface::elementClasses

File

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

Class

FieldPluginBase
Base class for views fields.

Namespace

Drupal\views\Plugin\views\field

Code

public function elementClasses($row_index = NULL) {
    $classes = $this->tokenizeValue($this->options['element_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.