You are here

public function InstallablePluginManager::createInstance in Markdown 8.2

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.

Overrides PluginManagerBase::createInstance

4 calls to InstallablePluginManager::createInstance()
AllowedHtmlManager::appliesTo in src/PluginManager/AllowedHtmlManager.php
Retrieves plugins that apply to a parser and active theme.
InstallablePluginManager::all in src/PluginManager/InstallablePluginManager.php
Retrieves all registered plugins.
InstallablePluginManager::installed in src/PluginManager/InstallablePluginManager.php
Retrieves all installed plugins.
ParserManager::createInstance in src/PluginManager/ParserManager.php
1 method overrides InstallablePluginManager::createInstance()
ParserManager::createInstance in src/PluginManager/ParserManager.php

File

src/PluginManager/InstallablePluginManager.php, line 201

Class

InstallablePluginManager
Installable Plugin Manager.

Namespace

Drupal\markdown\PluginManager

Code

public function createInstance($plugin_id, array $configuration = []) {

  /* @noinspection PhpUnhandledExceptionInspection */
  $instance = parent::createInstance($plugin_id, $configuration);
  if ($instance instanceof ContainerAwareInterface) {
    $instance
      ->setContainer($this
      ->getContainer());
  }
  return $instance;
}