diff --git a/core/modules/views/src/Plugin/views/style/AttachableStyleInterface.php b/core/modules/views/src/Plugin/views/style/AttachableStyleInterface.php index 38358e0..b538e18 100644 --- a/core/modules/views/src/Plugin/views/style/AttachableStyleInterface.php +++ b/core/modules/views/src/Plugin/views/style/AttachableStyleInterface.php @@ -13,13 +13,30 @@ * This style is being attached to the given display. * * @param array $build - * The build render array. - * @param $display_id + * The build render array, passed by reference. Implementations can + * directly attach render elements here, or alternatively, manipulate the + * `feed_icons` property of the view. + * @param string $display_id * The display ID that this style is being attached to. * @param \Drupal\Core\Url $url * The URL of this style display. - * @param $title + * @param string $title * This display's title. + * + * @code + * 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, + * ); + * } + * @endcode */ public function attachTo(array &$build, $display_id, Url $url, $title);