You are here

public function ContextAwarePluginTrait::setContextValue in Drupal 10

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php \Drupal\Core\Plugin\ContextAwarePluginTrait::setContextValue()

File

core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php, line 88

Class

ContextAwarePluginTrait
Provides a trait to add context-aware functionality to plugins.

Namespace

Drupal\Core\Plugin

Code

public function setContextValue($name, $value) {
  $this
    ->setContext($name, Context::createFromContext($this
    ->getContext($name), $value));
  return $this;
}