function ContextAwarePluginTrait::getContexts
Same name in other branches
- 9 core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php \Drupal\Core\Plugin\ContextAwarePluginTrait::getContexts()
- 11.x core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php \Drupal\Core\Plugin\ContextAwarePluginTrait::getContexts()
7 calls to ContextAwarePluginTrait::getContexts()
- ContextAwarePluginTrait::getCacheContexts in core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php - ContextAwarePluginTrait::getCacheMaxAge in core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php - ContextAwarePluginTrait::getCacheTags in core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php - ContextAwarePluginTrait::validateContexts in core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php - NavigationSectionStorage::getContextsDuringPreview in core/
modules/ navigation/ src/ Plugin/ SectionStorage/ NavigationSectionStorage.php - Gets contexts for use during preview.
File
-
core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php, line 34
Class
- ContextAwarePluginTrait
- Provides a trait to add context-aware functionality to plugins.
Namespace
Drupal\Core\PluginCode
public function getContexts() {
// Make sure all context objects are initialized.
foreach ($this->getContextDefinitions() as $name => $definition) {
$this->getContext($name);
}
return $this->context;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.