function FieldPluginBase::elementWrapperClasses

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

Overrides FieldHandlerInterface::elementWrapperClasses

File

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

Class

FieldPluginBase
Base class for views fields.

Namespace

Drupal\views\Plugin\views\field

Code

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