function OverridesSectionStorage::buildLocalTasks

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::buildLocalTasks()
  2. 10 core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::buildLocalTasks()
  3. 11.x core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::buildLocalTasks()

Overrides SectionStorageLocalTaskProviderInterface::buildLocalTasks

File

core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php, line 279

Class

OverridesSectionStorage
Defines the 'overrides' section storage type.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

public function buildLocalTasks($base_plugin_definition) {
    $local_tasks = [];
    foreach ($this->getEntityTypes() as $entity_type_id => $entity_type) {
        $local_tasks["layout_builder.overrides.{$entity_type_id}.view"] = $base_plugin_definition + [
            'route_name' => "layout_builder.overrides.{$entity_type_id}.view",
            'weight' => 15,
            'title' => $this->t('Layout'),
            'base_route' => "entity.{$entity_type_id}.canonical",
            'cache_contexts' => [
                'layout_builder_is_active:' . $entity_type_id,
            ],
        ];
    }
    return $local_tasks;
}

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