protected function ContextAwarePluginBase::createContextFromConfiguration in Drupal 8
Same name in this branch
- 8 core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php \Drupal\Core\Plugin\ContextAwarePluginBase::createContextFromConfiguration()
- 8 core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php \Drupal\Component\Plugin\ContextAwarePluginBase::createContextFromConfiguration()
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php \Drupal\Core\Plugin\ContextAwarePluginBase::createContextFromConfiguration()
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\PluginCode
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;
}