You are here

public function FieldPluginBase::elementClasses in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::elementClasses()

Returns the class of the field.

Parameters

bool $row_index: The index of current row.

Overrides FieldHandlerInterface::elementClasses

File

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

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);
}