You are here

protected function FormModesSubscriber::addFormModesRoutes in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/Routing/EventSubscriber/FormModesSubscriber.php \Drupal\form_mode_manager\Routing\EventSubscriber\FormModesSubscriber::addFormModesRoutes()

Generate all operations routes for entities.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection to retrieve parent entity routes.

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

array $form_modes: All form-modes available for specified entity_type_id.

2 calls to FormModesSubscriber::addFormModesRoutes()
FormModesSubscriber::alterRoutes in src/Routing/EventSubscriber/FormModesSubscriber.php
Alters existing routes for a specific collection.
UserFormModesSubscriber::alterRoutes in src/Routing/EventSubscriber/UserFormModesSubscriber.php
Alters existing routes for a specific collection.

File

src/Routing/EventSubscriber/FormModesSubscriber.php, line 106

Class

FormModesSubscriber
Subscriber for form_mode_manager routes.

Namespace

Drupal\form_mode_manager\Routing\EventSubscriber

Code

protected function addFormModesRoutes(RouteCollection $collection, EntityTypeInterface $entity_type, array $form_modes) {
  foreach ($form_modes as $form_mode) {
    $this
      ->setFormModeCollection($collection, $entity_type, $form_mode, 'admin_add');
    $this
      ->setFormModeCollection($collection, $entity_type, $form_mode, 'add_form');
    $this
      ->setFormModeCollection($collection, $entity_type, $form_mode, 'edit_form');
    $this
      ->setAddPageCollection($collection, $entity_type, $form_mode);
  }
}