You are here

private function FormModeManagerLocalTasks::setUserRegisterTasks 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::setUserRegisterTasks()

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::setUserRegisterTasks()
FormModeManagerLocalTasks::setFormModesTasks in src/Plugin/Derivative/FormModeManagerLocalTasks.php
Set the default tasks on each entities.

File

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

Class

FormModeManagerLocalTasks
Defines dynamic 'Form Mode Manager' local tasks.

Namespace

Drupal\form_mode_manager\Plugin\Derivative

Code

private function setUserRegisterTasks(array $form_mode, $entity_type_id) {
  if ('user' === $entity_type_id) {
    $this->derivatives["form_mode_manager.{$form_mode['id']}.register_task_tab"] = [
      'route_name' => "user.register.{$this->formModeManager->getFormModeMachineName($form_mode['id'])}",
      'title' => $this
        ->t('Create new account as @form_mode', [
        '@form_mode' => $form_mode['label'],
      ]),
      'base_route' => "user.page",
    ];
  }
}