3 namespace Drupal\views\Plugin\views\display;
6 * A plugin to handle defaults on a view.
8 * @ingroup views_display_plugins
12 * title = @Translation("Master"),
13 * help = @Translation("Default settings for this view."),
14 * theme = "views_view",
18 class DefaultDisplay extends DisplayPluginBase {
21 * Whether the display allows attachments.
25 protected $usesAttachments = TRUE;
28 * Determine if this display is the 'default' display which contains
31 public function isDefaultDisplay() {
36 * The default execute handler fully renders the view.
38 * For the simplest use:
40 * $output = $view->executeDisplay('default', $args);
43 * For more complex usages, a view can be partially built:
45 * $view->setArguments($args);
46 * $view->build('default'); // Build the query
47 * $view->preExecute(); // Pre-execute the query.
48 * $view->execute(); // Run the query
49 * $output = $view->render(); // Render the view
52 * If short circuited at any point, look in $view->build_info for
53 * information about the query. After execute, look in $view->result
54 * for the array of objects returned from db_query.
58 * $view->setArguments($args);
59 * $output = $view->render('default'); // Render the view
62 * This illustrates that render is smart enough to call build and execute
63 * if these items have not already been accomplished.
65 * Note that execute also must accomplish other tasks, such as setting page
66 * titles, and generating exposed filter data if necessary.
68 public function execute() {
69 return $this->view->render($this->display['id']);