function PluginBase::preRenderAddFieldsetMarkup

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

Overrides ViewsPluginInterface::preRenderAddFieldsetMarkup

File

core/modules/views/src/Plugin/views/PluginBase.php, line 487

Class

PluginBase
Base class for any views plugin types.

Namespace

Drupal\views\Plugin\views

Code

public static function preRenderAddFieldsetMarkup(array $form) {
    foreach (Element::children($form) as $key) {
        $element = $form[$key];
        // In our form builder functions, we added an arbitrary #fieldset property
        // to any element that belongs in a fieldset. If this form element has
        // that property, move it into its fieldset.
        if (isset($element['#fieldset']) && isset($form[$element['#fieldset']])) {
            $form[$element['#fieldset']][$key] = $element;
            // Remove the original element this duplicates.
            unset($form[$key]);
        }
    }
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.