You are here

public function DisplayPluginBase::acceptAttachments in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::acceptAttachments()

Determines whether this display can use attachments.

Return value

bool

Overrides DisplayPluginInterface::acceptAttachments

File

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

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function acceptAttachments() {
  if (!$this
    ->usesAttachments()) {
    return FALSE;
  }
  if (!empty($this->view->argument) && $this
    ->getOption('hide_attachment_summary')) {
    foreach ($this->view->argument as $argument) {
      if ($argument
        ->needsStylePlugin() && empty($argument->argument_validated)) {
        return FALSE;
      }
    }
  }
  return TRUE;
}