protected HtmlResponseAttachmentsProcessor::processFeed($attached_feed)
Transform a 'feed' attachment into an 'html_head_link' attachment.
The RSS feed is a special case of 'html_head_link', so we just turn it into one.
array $attached_feed: The ['#attached']['feed'] portion of a render array.
array An ['#attached']['html_head_link'] array, suitable for merging with another 'html_head_link' array.
protected function processFeed($attached_feed) { $html_head_link = []; foreach ($attached_feed as $item) { $feed_link = [ 'href' => $item[0], 'rel' => 'alternate', 'title' => empty($item[1]) ? '' : $item[1], 'type' => 'application/rss+xml', ]; $html_head_link[] = [$feed_link, FALSE]; } return ['html_head_link' => $html_head_link]; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!HtmlResponseAttachmentsProcessor.php/function/HtmlResponseAttachmentsProcessor::processFeed/8.1.x