function ViewsConfigUpdater::processTableCssClassUpdate
Processes views and adds default CSS table class value if necessary.
Parameters
\Drupal\views\ViewEntityInterface $view: The view entity.
Return value
bool TRUE if the view was updated with a default table CSS class value.
1 call to ViewsConfigUpdater::processTableCssClassUpdate()
- ViewsConfigUpdater::needsTableCssClassUpdate in core/
modules/ views/ src/ ViewsConfigUpdater.php - Checks for table style views needing a default CSS table class value.
File
-
core/
modules/ views/ src/ ViewsConfigUpdater.php, line 330
Class
- ViewsConfigUpdater
- Provides a BC layer for modules providing old configurations.
Namespace
Drupal\viewsCode
public function processTableCssClassUpdate(ViewEntityInterface $view) : bool {
$changed = FALSE;
$displays = $view->get('display');
foreach ($displays as &$display) {
if (isset($display['display_options']['style']) && $display['display_options']['style']['type'] === 'table' && !isset($display['display_options']['style']['options']['class'])) {
$display['display_options']['style']['options']['class'] = '';
$changed = TRUE;
}
}
if ($changed) {
$view->set('display', $displays);
}
return $changed;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.