public function StylePluginBase::getRowClass in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Plugin/views/style/StylePluginBase.php \Drupal\views\Plugin\views\style\StylePluginBase::getRowClass()
Return the token replaced row class for the specified row.
File
- core/
modules/ views/ src/ Plugin/ views/ style/ StylePluginBase.php, line 215 - Contains \Drupal\views\Plugin\views\style\StylePluginBase.
Class
- StylePluginBase
- Base class for views style plugins.
Namespace
Drupal\views\Plugin\views\styleCode
public function getRowClass($row_index) {
if ($this
->usesRowClass()) {
$class = $this->options['row_class'];
if ($this
->usesFields() && $this->view->field) {
$class = strip_tags($this
->tokenizeValue($class, $row_index));
}
$classes = explode(' ', $class);
foreach ($classes as &$class) {
$class = Html::cleanCssIdentifier($class);
}
return implode(' ', $classes);
}
}