You are here

function views_get_plugin in Views (for Drupal 7) 8.3

Same name and namespace in other branches
  1. 6.3 views.module \views_get_plugin()
  2. 6.2 views.module \views_get_plugin()
  3. 7.3 views.module \views_get_plugin()

Get an instance of a plugin.

Parameters

string $type: The plugin type, e.g., 'access' or 'display'.

string $plugin_id: The name of the plugin, e.g., 'standard'.

Return value

Drupal\views\Plugin\view\PluginBase The created plugin instance.

16 calls to views_get_plugin()
ArgumentPluginBase::get_plugin in lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
Get the display or row plugin, if it exists.
DisplayPluginBase::init in lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
DisplayPluginBase::optionsSummary in lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Provide the default summary for options in the views UI.
DisplayPluginBase::submitOptionsForm in lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.
FilterTest::testFilterQuery in lib/Drupal/views/Tests/Plugin/FilterTest.php
Test query of the row plugin.

... See full list

File

./views.module, line 1400
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_get_plugin($type, $plugin_id) {
  return drupal_container()
    ->get("plugin.manager.views.{$type}")
    ->createInstance($plugin_id);
}