class DefaultDisplay

A plugin to handle defaults on a view.

Plugin annotation


@Plugin(
  id = "default",
  title = @Translation("Master"),
  help = @Translation("Default settings for this view."),
  theme = "views_view",
  no_ui = TRUE
)

Hierarchy

Expanded class hierarchy of DefaultDisplay

Related topics

2 files declare their use of DefaultDisplay
ViewExecutableTest.php in drupal/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php
Definition of Drupal\views\Tests\ViewExecutableTest.
ViewStorageTest.php in drupal/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
Definition of Drupal\views\Tests\ViewStorageTest.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DefaultDisplay.php, line 26
Definition of Drupal\views\Plugin\views\display\DefaultDisplay.

Namespace

Drupal\views\Plugin\views\display
View source
class DefaultDisplay extends DisplayPluginBase {

  /**
   * Whether the display allows attachments.
   *
   * @var bool
   */
  protected $usesAttachments = TRUE;

  /**
   * Determine if this display is the 'default' display which contains
   * fallback settings
   */
  public function isDefaultDisplay() {
    return TRUE;
  }

  /**
   * The default execute handler fully renders the view.
   *
   * For the simplest use:
   * @code
   *   $output = $view->executeDisplay('default', $args);
   * @endcode
   *
   * For more complex usages, a view can be partially built:
   * @code
   *   $view->setArguments($args);
   *   $view->build('default'); // Build the query
   *   $view->preExecute(); // Pre-execute the query.
   *   $view->execute(); // Run the query
   *   $output = $view->render(); // Render the view
   * @endcode
   *
   * If short circuited at any point, look in $view->build_info for
   * information about the query. After execute, look in $view->result
   * for the array of objects returned from db_query.
   *
   * You can also do:
   * @code
   *   $view->setArguments($args);
   *   $output = $view->render('default'); // Render the view
   * @endcode
   *
   * This illustrates that render is smart enough to call build and execute
   * if these items have not already been accomplished.
   *
   * Note that execute also must accomplish other tasks, such
   * as setting page titles, breadcrumbs, and generating exposed filter
   * data if necessary.
   */
  public function execute() {
    return $this->view
      ->render($this->display['id']);
  }

}

Members

Namesort ascending Modifiers Type Description Overrides
PluginBase::__construct public function Constructs a Plugin object. Overrides PluginBase::__construct
PluginBase::usesOptions public function Returns the usesOptions property. 8
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. 1
PluginBase::summaryTitle public function Returns the summary of the settings in the display. 6
PluginBase::setOptionDefaults protected function
PluginBase::pluginTitle public function Return the human readable name of the display.
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced.
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form.
PluginBase::getPluginId public function Implements Drupal\Component\Plugin\PluginInterface::getPluginId(). Overrides PluginInspectionInterface::getPluginId
PluginBase::getDefinition public function Implements Drupal\Component\Plugin\PluginInterface::getDefinition(). Overrides PluginInspectionInterface::getDefinition
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements.
PluginBase::additionalThemeFunctions public function Provide a list of additional theme functions for the theme information page
PluginBase::$plugin_id protected property The plugin_id.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$discovery protected property The discovery object.
PluginBase::$definition public property Plugins's definition
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
DisplayPluginBase::viewSpecialBlocks public function Render any special blocks provided for this display.
DisplayPluginBase::validateOptionsForm public function Validate the options form. Overrides PluginBase::validateOptionsForm 2
DisplayPluginBase::validate public function Make sure the display and all associated handlers are valid. Overrides PluginBase::validate 1
DisplayPluginBase::usesPager public function Whether the display allows the use of a pager or not. 2
DisplayPluginBase::usesMore public function Whether the display allows the use of a 'more' link or not.
DisplayPluginBase::usesLinkDisplay public function Check to see if the display has some need to link to another display. 1
DisplayPluginBase::usesFields public function Determine if the display's style uses fields.
DisplayPluginBase::usesExposedFormInBlock public function Check to see if the display can put the exposed formin a block.
DisplayPluginBase::usesExposed public function Determine if this display uses exposed filters, so the view will know whether or not to build them. 2
DisplayPluginBase::usesBreadcrumb public function Check to see if the display needs a breadcrumb 1
DisplayPluginBase::usesAttachments public function Returns whether the display can use attachments. 4
DisplayPluginBase::usesAreas public function Returns whether the display can use areas. 1
DisplayPluginBase::usesAJAX public function Whether the display allows the use of AJAX or not. 1
DisplayPluginBase::useMoreText public function Does the display have custom link text?
DisplayPluginBase::useMoreAlways public function Should the enabled display more link be shown when no more items?
DisplayPluginBase::useGroupBy public function Does the display have groupby enabled?
DisplayPluginBase::submitOptionsForm public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data. Overrides PluginBase::submitOptionsForm 4
DisplayPluginBase::setOverride public function Flip the override setting for the given section.
DisplayPluginBase::setOption public function Intelligently set an option either from this display or from the default display, if directed to do so.
DisplayPluginBase::renderPager public function Not all display plugins will suppert pager rendering. 1
DisplayPluginBase::renderMoreLink public function Render the 'more' link
DisplayPluginBase::renderHeader public function Render the header of the view.
DisplayPluginBase::renderFooter public function Render the footer of the view.
DisplayPluginBase::renderFilters public function Not all display plugins will support filtering
DisplayPluginBase::renderEmpty public function
DisplayPluginBase::renderArea public function
DisplayPluginBase::render public function Render this display. 1
DisplayPluginBase::query public function Inject anything into the query that the display handler needs. Overrides PluginBase::query
DisplayPluginBase::preview function Fully render the display for the purposes of a live preview or some other AJAXy reason. 2
DisplayPluginBase::preExecute public function Set up any variables on the view prior to execution. These are separated from execute because they are extremely common and unlikely to be overridden on an individual display.
DisplayPluginBase::overrideOption public function Set an option and force it to be an override.
DisplayPluginBase::optionsSummary public function Provide the default summary for options in the views UI. 4
DisplayPluginBase::optionsOverride public function If override/revert was clicked, perform the proper toggle.
DisplayPluginBase::optionLink public function Because forms may be split up into sections, this provides an easy URL to exactly the right section. Don't override this.
DisplayPluginBase::isPagerEnabled public function Whether the display is using a pager or not.
DisplayPluginBase::isMoreEnabled public function Whether the display is using the 'more' link or not.
DisplayPluginBase::isIdentifierUnique public function Check if the provided identifier is unique.
DisplayPluginBase::isEnabled public function Whether the display is enabled.
DisplayPluginBase::isDefaulted public function Determine if a given option is set to use the default display or the current display
DisplayPluginBase::isAJAXEnabled public function Whether the display is actually using AJAX or not.
DisplayPluginBase::init public function 1
DisplayPluginBase::hookMenu public function If this display creates a page with a menu item, implement it here.
DisplayPluginBase::hookBlockList public function If this display creates a block, implement one of these.
DisplayPluginBase::hasPath public function Check to see if the display has a 'path' field. 1
DisplayPluginBase::getUrl public function
DisplayPluginBase::getStyleType protected function Displays can require a certain type of style plugin. By default, they will be 'normal'. 1
DisplayPluginBase::getSpecialBlocks public function Provide the block system with any exposed widget blocks for this display.
DisplayPluginBase::getPlugin public function Get the instance of a plugin, for example style or row.
DisplayPluginBase::getPath public function Return the base path to use for this display.
DisplayPluginBase::getPagerText public function Provide some helpful text for pagers. 1
DisplayPluginBase::getOption public function Intelligently get an option either from this display or from the default display, if directed to do so.
DisplayPluginBase::getLinkDisplay public function Check to see which display to use when creating links within a view using this display.
DisplayPluginBase::getHandlers public function Get a full array of handlers for $type. This caches them.
DisplayPluginBase::getHandler public function Get the handler object for a single handler.
DisplayPluginBase::getFieldLabels public function Retrieve a list of fields for the current display with the relationship associated if it exists.
DisplayPluginBase::getArgumentText public function Provide some helpful text for the arguments. The result should contain of an array with 1
DisplayPluginBase::getArgumentsTokens public function Returns to tokens for arguments.
DisplayPluginBase::formatThemes protected function Format a list of theme templates for output by the theme info helper.
DisplayPluginBase::displaysExposed public function Determine if this display should display the exposed filters widgets, so the view will know whether or not to render them. 1
DisplayPluginBase::destroy public function Clears a plugin. Overrides PluginBase::destroy
DisplayPluginBase::defineOptions protected function Information about options for all kinds of purposes will be held here. @code 'option_name' => array( Overrides PluginBase::defineOptions 4
DisplayPluginBase::defaultableSections public function Static member function to list which sections are defaultable and what items each section contains. 1
DisplayPluginBase::buildOptionsForm public function Provide the default form for setting options. Overrides PluginBase::buildOptionsForm 4
DisplayPluginBase::attachTo public function Allow displays to attach to other views. 2
DisplayPluginBase::access public function Determine if the user has access to this display of the view.
DisplayPluginBase::acceptAttachments public function Determines whether this display can use attachments.
DisplayPluginBase::$view property The top object of a view. Overrides PluginBase::$view
DisplayPluginBase::$usesPager protected property Whether the display allows the use of a pager or not. 2
DisplayPluginBase::$usesOptions protected property Overrides Drupal\views\Plugin\Plugin::$usesOptions. Overrides PluginBase::$usesOptions
DisplayPluginBase::$usesMore protected property Whether the display allows the use of a 'more' link or not.
DisplayPluginBase::$usesAreas protected property Whether the display allows area plugins. 1
DisplayPluginBase::$usesAJAX protected property Whether the display allows the use of AJAX or not. 1
DisplayPluginBase::$plugins protected property An array of instantiated plugins used in this display.
DisplayPluginBase::$output public property Stores the rendered output of the display.
DisplayPluginBase::$handlers property
DisplayPluginBase::$extender property Stores all available display extenders.
DefaultDisplay::isDefaultDisplay public function Determine if this display is the 'default' display which contains fallback settings Overrides DisplayPluginBase::isDefaultDisplay
DefaultDisplay::execute public function The default execute handler fully renders the view. Overrides DisplayPluginBase::execute
DefaultDisplay::$usesAttachments protected property Whether the display allows attachments. Overrides DisplayPluginBase::$usesAttachments