function PluginBase::preRenderFlattenData
Same name in other branches
- 9 core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::preRenderFlattenData()
- 10 core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::preRenderFlattenData()
- 11.x core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::preRenderFlattenData()
Overrides ViewsPluginInterface::preRenderFlattenData
File
-
core/
modules/ views/ src/ Plugin/ views/ PluginBase.php, line 502
Class
- PluginBase
- Base class for any views plugin types.
Namespace
Drupal\views\Plugin\viewsCode
public static function preRenderFlattenData($form) {
foreach (Element::children($form) as $key) {
$element = $form[$key];
if (!empty($element['#flatten'])) {
foreach (Element::children($element) as $child_key) {
$form[$child_key] = $form[$key][$child_key];
}
// All done, remove the now-empty parent.
unset($form[$key]);
}
}
return $form;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.