You are here

public function ContextAwarePluginDefinitionInterface::addContextDefinition in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionInterface.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface::addContextDefinition()
  2. 9 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionInterface.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface::addContextDefinition()

Adds a context to this plugin definition.

Parameters

string $name: The context name.

\Drupal\Component\Plugin\Context\ContextDefinitionInterface $definition: The context definition.

Return value

$this The called object.

File

core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionInterface.php, line 58

Class

ContextAwarePluginDefinitionInterface
Provides an interface for plugin definitions which use contexts.

Namespace

Drupal\Component\Plugin\Definition

Code

public function addContextDefinition($name, ContextDefinitionInterface $definition);