You are here

public function ContextAwarePluginBase::getContextValue in Drupal 8

Same name and namespace in other branches
  1. 9 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\PluginException If the requested context is not set.

Overrides ContextAwarePluginInterface::getContextValue

18 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.
DefaultsSectionStorage::getSectionList in core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php
Gets the section list.
ExtraFieldBlock::getEntity in core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php
Gets the entity that has the field.
FieldBlock::build in core/modules/layout_builder/src/Plugin/Block/FieldBlock.php
Builds and returns the renderable array for this block plugin.
FieldBlock::getEntity in core/modules/layout_builder/src/Plugin/Block/FieldBlock.php
Gets the entity that has the field.

... See full list

File

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

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Component\Plugin

Code

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