public function DisplayPluginBase::getPlugin

Get the instance of a plugin, for example style or row.

Parameters

string $type: The type of the plugin.

Return value

\Drupal\views\Plugin\views\PluginBase

12 calls to DisplayPluginBase::getPlugin()
DisplayPluginBase::access in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Determine if the user has access to this display of the view.
DisplayPluginBase::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Provide the default form for setting options.
DisplayPluginBase::isPagerEnabled in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Whether the display is using a pager or not.
DisplayPluginBase::optionsSummary in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Provide the default summary for options in the views UI.
DisplayPluginBase::preExecute in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
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.

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 772
Contains Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Namespace

Drupal\views\Plugin\views\display

Code

public function getPlugin($type) {

  // Look up the plugin name to use for this instance.
  $options = $this
    ->getOption($type);
  $name = $options['type'];

  // Query plugins allow specifying a specific query class per base table.
  if ($type == 'query') {
    $views_data = views_fetch_data($this->view->storage
      ->get('base_table'));
    $name = isset($views_data['table']['base']['query_id']) ? $views_data['table']['base']['query_id'] : 'views_query';
  }

  // Plugin instances are stored on the display for re-use.
  if (!isset($this->plugins[$type][$name])) {
    $plugin = drupal_container()
      ->get("plugin.manager.views.{$type}")
      ->createInstance($name);

    // Initialize the plugin.
    $plugin
      ->init($this->view, $this, $options['options']);
    $this->plugins[$type][$name] = $plugin;
  }
  return $this->plugins[$type][$name];
}