public function DisplayPluginBase::viewExposedFormBlocks in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::viewExposedFormBlocks()
Renders the exposed form as block.
Return value
string|null The rendered exposed form as string or NULL otherwise.
Overrides DisplayPluginInterface::viewExposedFormBlocks
File
- core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php, line 2531 - Contains \Drupal\views\Plugin\views\display\DisplayPluginBase.
Class
- DisplayPluginBase
- Base class for views display plugins.
Namespace
Drupal\views\Plugin\views\displayCode
public function viewExposedFormBlocks() {
// Avoid interfering with the admin forms.
$route_name = \Drupal::routeMatch()
->getRouteName();
if (strpos($route_name, 'views_ui.') === 0) {
return;
}
$this->view
->initHandlers();
if ($this
->usesExposed() && $this
->getOption('exposed_block')) {
$exposed_form = $this
->getPlugin('exposed_form');
return $exposed_form
->renderExposedForm(TRUE);
}
}