function Feed::preview

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/display/Feed.php \Drupal\views\Plugin\views\display\Feed::preview()
  2. 8.9.x core/modules/views/src/Plugin/views/display/Feed.php \Drupal\views\Plugin\views\display\Feed::preview()
  3. 11.x core/modules/views/src/Plugin/views/display/Feed.php \Drupal\views\Plugin\views\display\Feed::preview()

Overrides DisplayPluginBase::preview

File

core/modules/views/src/Plugin/views/display/Feed.php, line 173

Class

Feed
The plugin that handles a feed, such as RSS or atom.

Namespace

Drupal\views\Plugin\views\display

Code

public function preview() {
    $output = $this->view
        ->render();
    if (!empty($this->view->live_preview)) {
        $output = [
            '#prefix' => '<pre>',
            '#plain_text' => $this->renderer
                ->renderRoot($output),
            '#suffix' => '</pre>',
        ];
    }
    return $output;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.