8.5.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.5.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.0.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.0.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.1.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.1.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.2.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.2.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.3.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.3.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.4.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.4.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.6.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)
8.6.x ContextAwarePluginBase.php ContextAwarePluginBase::createContextFromConfiguration(array $context_configuration)

Return value

\Drupal\Core\Plugin\Context\ContextInterface[]

Overrides ContextAwarePluginBase::createContextFromConfiguration

File

core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php, line 30

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Core\Plugin

Code

protected function createContextFromConfiguration(array $context_configuration) {

  // This method is overridden so that it will use
  // \Drupal\Core\Plugin\Context\Context instead.
  $contexts = [];
  foreach ($context_configuration as $key => $value) {
    $context_definition = $this
      ->getContextDefinition($key);
    $contexts[$key] = new Context($context_definition, $value);
  }
  return $contexts;
}