Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ArgumentPluginBase.php

function ArgumentPluginBase::getPlugin

Get the display or row plugin, if it exists.

13 calls to ArgumentPluginBase::getPlugin()
ArgumentPluginBase::adminSummary in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Provide text for the administrative summary.
ArgumentPluginBase::buildOptionsForm in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Provide a form to edit options for this plugin.
ArgumentPluginBase::calculateDependencies in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Calculates dependencies for the configured plugin.
ArgumentPluginBase::defaultArgumentForm in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Provides a form for selecting the default argument.
ArgumentPluginBase::defaultSummaryForm in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Provides a form for selecting summary options.

... See full list

File

core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php, line 1148

Class

ArgumentPluginBase
Base class for argument (contextual filter) handler plugins.

Namespace

Drupal\views\Plugin\views\argument

Code

public function getPlugin($type = 'argument_default', $name = NULL) {
    $options = [];
    $plugin_name = match ($type) {    'argument_default' => $this->options['default_argument_type'] ?? NULL,
        'argument_validator' => $this->options['validate']['type'] ?? NULL,
        'style' => $this->options['summary']['format'] ?? NULL,
    
    };
    if ($plugin_name === NULL) {
        return NULL;
    }
    $options_name = match ($type) {    'argument_default' => 'default_argument_options',
        'argument_validator' => 'validate_options',
        'style' => 'summary_options',
    
    };
    if (!$name) {
        $name = $plugin_name;
    }
    // We only fetch the options if we're fetching the plugin actually
    // in use.
    if ($name == $plugin_name) {
        $options = $this->options[$options_name] ?? [];
    }
    $plugin = Views::pluginManager($type)->createInstance($name);
    if ($plugin) {
        $plugin->init($this->view, $this->displayHandler, $options);
        if ($type !== 'style') {
            // It's an argument_default/argument_validate plugin, so set the argument.
            $plugin->setArgument($this);
        }
        return $plugin;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal