You are here

public function ContextAwarePluginInterface::getContext in Drupal 10

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

Gets a defined context.

Parameters

string $name: The name of the context in the plugin definition.

Return value

\Drupal\Component\Plugin\Context\ContextInterface The context object.

Throws

\Drupal\Component\Plugin\Exception\ContextException If the requested context is not set.

File

core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php, line 62

Class

ContextAwarePluginInterface
Interface for defining context aware plugins.

Namespace

Drupal\Component\Plugin

Code

public function getContext($name);