You are here

public function PagererStyleManager::createInstance in Pagerer 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/PagererStyleManager.php \Drupal\pagerer\Plugin\PagererStyleManager::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.

Overrides PluginManagerBase::createInstance

File

src/Plugin/PagererStyleManager.php, line 36

Class

PagererStyleManager
Plugin manager for Pagerer style plugins.

Namespace

Drupal\pagerer\Plugin

Code

public function createInstance($plugin_id, array $configuration = []) {
  $default_configuration = $this->configFactory
    ->get('pagerer.style.' . $plugin_id)
    ->get('default_config');
  $configuration = NestedArray::mergeDeep($default_configuration, $configuration);
  return parent::createInstance($plugin_id, $configuration);
}