function ContextAwarePluginInterface::getContext

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface::getContext()
  2. 10 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface::getContext()
  3. 11.x 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\PluginException If the requested context is not set.

1 method overrides ContextAwarePluginInterface::getContext()
ContextAwarePluginBase::getContext in core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php
Gets a defined context.

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);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.