You are here

public function ContextAwarePluginBase::getContextValue in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php \Drupal\Component\Plugin\ContextAwarePluginBase::getContextValue()

Gets the value for a defined context.

Parameters

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

Return value

mixed The currently set context value.

Throws

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

Overrides ContextAwarePluginInterface::getContextValue

File

core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php, line 141

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Component\Plugin

Code

public function getContextValue($name) {
  return $this
    ->getContext($name)
    ->getContextValue();
}