function SimpleConfigSectionStorage::buildLocalTasks

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::buildLocalTasks()
  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::buildLocalTasks()
  3. 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage::buildLocalTasks()

Overrides SectionStorageLocalTaskProviderInterface::buildLocalTasks

File

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

Class

SimpleConfigSectionStorage
Provides section storage utilizing simple config.

Namespace

Drupal\layout_builder_test\Plugin\SectionStorage

Code

public function buildLocalTasks($base_plugin_definition) {
    $type = $this->getStorageType();
    $local_tasks = [];
    $local_tasks["layout_builder.{$type}.view"] = $base_plugin_definition + [
        'route_name' => "layout_builder.{$type}.view",
        'title' => $this->t('Layout'),
        'base_route' => "layout_builder.{$type}.view",
    ];
    $local_tasks["layout_builder.{$type}.view__child"] = $base_plugin_definition + [
        'route_name' => "layout_builder.{$type}.view",
        'title' => $this->t('Layout'),
        'parent_id' => "layout_builder_ui:layout_builder.{$type}.view",
    ];
    $local_tasks["layout_builder.{$type}.discard_changes"] = $base_plugin_definition + [
        'route_name' => "layout_builder.{$type}.discard_changes",
        'title' => $this->t('Discard changes'),
        'parent_id' => "layout_builder_ui:layout_builder.{$type}.view",
        'weight' => 5,
    ];
    return $local_tasks;
}

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