function DisplayPluginBase::renderArea

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

Overrides DisplayPluginInterface::renderArea

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 2278

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function renderArea($area, $empty = FALSE) {
    $return = [];
    foreach ($this->getHandlers($area) as $key => $area_handler) {
        if ($area_render = $area_handler->render($empty)) {
            if (isset($area_handler->position)) {
                // Fix weight of area.
                $area_render['#weight'] = $area_handler->position;
            }
            $return[$key] = $area_render;
        }
    }
    return $return;
}

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