public function Block::execute

The display block handler returns the structure necessary for a block.

Overrides DisplayPluginBase::execute

File

drupal/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php, line 77
Definition of Drupal\views\Plugin\views\display\Block. Definition of Drupal\block\Plugin\views\display\Block.

Class

Block
The plugin that handles a block.

Namespace

Drupal\block\Plugin\views\display

Code

public function execute() {

  // Prior to this being called, the $view should already be set to this
  // display, and arguments should be set on the view.
  $element = $this->view
    ->render();
  $info['content'] = drupal_render($element);
  $info['subject'] = filter_xss_admin($this->view
    ->getTitle());
  if (!empty($this->view->result) || $this
    ->getOption('empty') || !empty($this->view->style_plugin->definition['even empty'])) {
    return $info;
  }
}