private function FormModeManagerLocalTasks::setUserRegisterTasks in Form mode manager 8.2
Same name and namespace in other branches
- 8 src/Plugin/Derivative/FormModeManagerLocalTasks.php \Drupal\form_mode_manager\Plugin\Derivative\FormModeManagerLocalTasks::setUserRegisterTasks()
Set a Specific local tasks to `user.page` pages (register).
@TODO Use EntityRoutingMap to format an entity generic route_name. @TODO Use EntityRoutingMap to retrieve base_route. @TODO Make this part more generic now.
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 166
Class
- FormModeManagerLocalTasks
- Defines dynamic 'Form Mode Manager' local tasks.
Namespace
Drupal\form_mode_manager\Plugin\DerivativeCode
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",
];
}
}