You are here

private function FormModeManagerLocalTasks::setFormModesTasksBase in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Derivative/FormModeManagerLocalTasks.php \Drupal\form_mode_manager\Plugin\Derivative\FormModeManagerLocalTasks::setFormModesTasksBase()

Set a Specific local tasks to `user.page` pages (register).

Parameters

array $form_mode: An associative array represent a DisplayForm entity.

string $entity_type_id: The entity type ID.

1 call to FormModeManagerLocalTasks::setFormModesTasksBase()
FormModeManagerLocalTasks::setFormModesTasks in src/Plugin/Derivative/FormModeManagerLocalTasks.php
Set the default tasks on each entities.

File

src/Plugin/Derivative/FormModeManagerLocalTasks.php, line 174

Class

FormModeManagerLocalTasks
Defines dynamic 'Form Mode Manager' local tasks.

Namespace

Drupal\form_mode_manager\Plugin\Derivative

Code

private function setFormModesTasksBase(array $form_mode, $entity_type_id) {
  $this->derivatives["form_mode_manager.{$form_mode['id']}.task_tab"] = [
    'route_name' => "entity.{$entity_type_id}.edit_form.{$this->formModeManager->getFormModeMachineName($form_mode['id'])}",
    'title' => $this
      ->t('Edit as @form_mode', [
      '@form_mode' => $form_mode['label'],
    ]),
    'parent_id' => "entity.{$entity_type_id}.edit_form",
    'cache_tags' => $this->cacheTags,
  ];
}