You are here

public function ViewsExposedFilterBlock::build in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php \Drupal\views\Plugin\Block\ViewsExposedFilterBlock::build()

Builds and returns the renderable array for this block plugin.

If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with #cache set (with cacheability metadata indicating the circumstances for it being empty).

Return value

array A renderable array representing the content of the block.

Overrides BlockPluginInterface::build

See also

\Drupal\block\BlockViewBuilder

File

core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php, line 24
Contains \Drupal\views\Plugin\Block\ViewsExposedFilterBlock.

Class

ViewsExposedFilterBlock
Provides a 'Views Exposed Filter' block.

Namespace

Drupal\views\Plugin\Block

Code

public function build() {
  $output = $this->view->display_handler
    ->viewExposedFormBlocks();

  // Before returning the block output, convert it to a renderable array with
  // contextual links.
  $this
    ->addContextualLinks($output, 'exposed_filter');
  return $output;
}