public function Pdf::attachTo in PDF Generator 8
Same name and namespace in other branches
- 2.0.x src/Plugin/views/display/Pdf.php \Drupal\pdf_generator\Plugin\views\display\Pdf::attachTo()
Allows displays to attach to other views.
Parameters
\Drupal\views\ViewExecutable $view: The views executable.
string $display_id: The display to attach to.
array $build: The parent view render array.
Overrides DisplayPluginBase::attachTo
File
- src/
Plugin/ views/ display/ Pdf.php, line 416
Class
- The plugin that handles a feed, such as RSS or atom.
Namespace
Drupal\pdf_generator\Plugin\views\displayCode
public function attachTo(ViewExecutable $clone, $display_id, array &$build) {
$displays = $this
->getOption('displays');
if (empty($displays[$display_id])) {
return;
}
// Defer to the feed style; it may put in meta information, and/or
// attach a feed icon.
$clone
->setArguments($this->view->args);
$clone
->setDisplay($this->display['id']);
$clone
->buildTitle();
if ($plugin = $clone->display_handler
->getPlugin('style')) {
$plugin
->attachTo($build, $display_id, $clone
->getUrl(), $clone
->getTitle());
foreach ($clone->feedIcons as $feed_icon) {
$this->view->feedIcons[] = $feed_icon;
}
}
// Clean up.
$clone
->destroy();
unset($clone);
}