function DisplayPluginBase::viewExposedFormBlocks

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

Overrides DisplayPluginInterface::viewExposedFormBlocks

File

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

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function viewExposedFormBlocks() {
    // Avoid interfering with the admin forms.
    $route_name = \Drupal::routeMatch()->getRouteName();
    if (str_starts_with($route_name, 'views_ui.')) {
        return;
    }
    $this->view
        ->initHandlers();
    if ($this->usesExposed() && $this->getOption('exposed_block')) {
        
        /** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface $exposed_form */
        $exposed_form = $this->getPlugin('exposed_form');
        return $exposed_form->renderExposedForm(TRUE);
    }
}

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