8.5.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextValue($name)
8.0.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextValue($name)
8.1.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextValue($name)
8.2.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextValue($name)
8.3.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextValue($name)
8.4.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextValue($name)
8.6.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextValue($name)

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\PluginException If the requested context is not set.

Overrides ContextAwarePluginInterface::getContextValue

9 calls to ContextAwarePluginBase::getContextValue()
ConditionTestDualUser::evaluate in core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php
Evaluates the condition and returns TRUE or FALSE accordingly.
Language::evaluate in core/modules/language/src/Plugin/Condition/Language.php
Evaluates the condition and returns TRUE or FALSE accordingly.
MockComplexContextBlock::getTitle in core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockComplexContextBlock.php
MockUserNameBlock::getTitle in core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserNameBlock.php
NodeType::evaluate in core/modules/node/src/Plugin/Condition/NodeType.php
Evaluates the condition and returns TRUE or FALSE accordingly.

... See full list

File

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

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Component\Plugin

Code

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