function PluginBase::create

Instantiates a new instance of the implementing class using autowiring.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container to pull out services used in the plugin.

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Return value

static

See also

\Drupal\Core\Plugin\ContainerFactoryPluginInterface

165 methods override PluginBase::create()
AjaxFormBlock::create in core/modules/system/tests/modules/ajax_forms_test/src/Plugin/Block/AjaxFormBlock.php
Instantiates a new instance of the implementing class using autowiring.
AnnounceBlock::create in core/modules/announcements_feed/src/Plugin/Block/AnnounceBlock.php
Instantiates a new instance of the implementing class using autowiring.
BlockedIp::create in core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php
Instantiates a new instance of the implementing class using autowiring.
BlockPageVariant::create in core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php
Instantiates a new instance of the implementing class using autowiring.
BlockPluginId::create in core/modules/block/src/Plugin/migrate/process/BlockPluginId.php
Instantiates a new instance of the implementing class using autowiring.

... See full list

File

core/lib/Drupal/Core/Plugin/PluginBase.php, line 40

Class

PluginBase
Base class for plugins supporting metadata inspection and translation.

Namespace

Drupal\Core\Plugin

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  return static::createInstanceAutowired($container, $configuration, $plugin_id, $plugin_definition);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.