You are here

protected function FormModesSubscriber::getFormModeRouteRequirements in Form mode manager 8.2

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

Get options requirements nedeed to build Form Mode Manager routes.

Parameters

array $form_mode_infos: The form mode info.

Return value

array Array contain requirements routes parameters.

1 call to FormModesSubscriber::getFormModeRouteRequirements()
FormModesSubscriber::setRoutes in src/Routing/EventSubscriber/FormModesSubscriber.php
Generate a routes based on top of given parent routes.

File

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

Class

FormModesSubscriber
Listens to the dynamic route event and add routes using form modes.

Namespace

Drupal\form_mode_manager\Routing\EventSubscriber

Code

protected function getFormModeRouteRequirements(array $form_mode_infos) {
  return [
    '_permission' => "use {$form_mode_infos['id']} form mode",
    '_custom_access' => static::FORM_MODE_DEFAULT_CONTROLLER . '::checkAccess',
  ];
}