You are here

public function FactoryInterface::createInstance in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Component/Plugin/Factory/FactoryInterface.php \Drupal\Component\Plugin\Factory\FactoryInterface::createInstance()

Creates a pre-configured instance of a plugin.

Parameters

string $plugin_id: The ID of the plugin being instantiated.

array $configuration: An array of configuration relevant to the plugin instance.

Return value

object A fully configured plugin instance.

Throws

\Drupal\Component\Plugin\Exception\PluginException If the instance cannot be created, such as if the ID is invalid.

4 methods override FactoryInterface::createInstance()
ContainerAwarePluginManager::createInstance in src/Plugin/ContainerAwarePluginManager.php
Creates a pre-configured instance of a plugin.
DefaultFactory::createInstance in lib/Drupal/Component/Plugin/Factory/DefaultFactory.php
Creates a pre-configured instance of a plugin.
PluginManagerBase::createInstance in src/Plugin/PluginManagerBase.php
Creates a pre-configured instance of a plugin.
PluginManagerBase::createInstance in lib/Drupal/Component/Plugin/PluginManagerBase.php
Creates a pre-configured instance of a plugin.

File

lib/Drupal/Component/Plugin/Factory/FactoryInterface.php, line 28
Contains \Drupal\Component\Plugin\Factory\FactoryInterface.

Class

FactoryInterface
Factory interface implemented by all plugin factories.

Namespace

Drupal\Component\Plugin\Factory

Code

public function createInstance($plugin_id, array $configuration = array());