public function Opml::attachTo in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Plugin/views/style/Opml.php \Drupal\views\Plugin\views\style\Opml::attachTo()
File
- core/
modules/ views/ src/ Plugin/ views/ style/ Opml.php, line 37 - Contains \Drupal\views\Plugin\views\style\Opml.
Class
- Opml
- Default style plugin to render an OPML feed.
Namespace
Drupal\views\Plugin\views\styleCode
public function attachTo(array &$build, $display_id, Url $feed_url, $title) {
$display = $this->view->displayHandlers
->get($display_id);
$url_options = array();
$input = $this->view
->getExposedInput();
if ($input) {
$url_options['query'] = $input;
}
$url_options['absolute'] = TRUE;
$url = $feed_url
->setOptions($url_options)
->toString();
if ($display
->hasPath()) {
if (empty($this->preview)) {
$build['#attached']['feed'][] = array(
$url,
$title,
);
}
}
else {
$this->view->feedIcons[] = array(
'#theme' => 'feed_icon',
'#url' => $url,
'#title' => $title,
);
}
}