function SimpleConfigSectionStorage::deriveContextsFromRoute

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage::deriveContextsFromRoute()
  2. 8.9.x core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage::deriveContextsFromRoute()
  3. 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage::deriveContextsFromRoute()

Overrides SectionStorageInterface::deriveContextsFromRoute

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php, line 145

Class

SimpleConfigSectionStorage
Provides section storage utilizing simple config.

Namespace

Drupal\layout_builder_test\Plugin\SectionStorage

Code

public function deriveContextsFromRoute($value, $definition, $name, array $defaults) {
    $contexts['config_id'] = new Context(new ContextDefinition('string'), $value ?: $defaults['id']);
    return $contexts;
}

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