/** * Overrides \Drupal\views\Plugin\views\display\PathPluginBase::execute(). */ public function execute() { parent::execute(); $output = $this->view->render(); if (empty($output)) { throw new NotFoundHttpException(); } $response = $this->view->getResponse(); $response->setContent($output); return $response; }
/** * Overrides \Drupal\views\Plugin\views\display\PathPluginBase::execute(). */ public function execute() { parent::execute(); // Let the world know that this is the page view we're using. views_set_page_view($this->view); // And now render the view. $render = $this->view->render(); // First execute the view so it's possible to get tokens for the title. // And the title, which is much easier. // @todo Figure out how to support custom response objects. Maybe for pages // it should be dropped. if (is_array($render)) { $render += array('#title' => Xss::filterAdmin($this->view->getTitle())); } return $render; }
/** * Overrides \Drupal\views\Plugin\views\display\PathPluginBase::execute(). */ public function execute() { parent::execute(); // And now render the view. $render = $this->view->render(); // First execute the view so it's possible to get tokens for the title. // And the title, which is much easier. // @todo Figure out how to support custom response objects. Maybe for pages // it should be dropped. if (is_array($render)) { $render += array('#title' => ['#markup' => $this->view->getTitle(), '#allowed_tags' => Xss::getHtmlTagList()]); } return $render; }
/** * {@inheritdoc} */ public function execute() { parent::execute(); return $this->view->render(); }
/** * {@inheritdoc} */ public function execute() { parent::execute(); $output = $this->view->render(); return new Response(drupal_render_root($output), 200, array('Content-type' => $this->getMimeType())); }
/** * {@inheritdoc} */ public function execute() { parent::execute(); $output = $this->view->render(); $header = []; $header['Content-type'] = $this->getMimeType(); $response = new CacheableResponse($this->renderer->renderRoot($output), 200); $cache_metadata = CacheableMetadata::createFromRenderArray($output); $response->addCacheableDependency($cache_metadata); return $response; }