You are here

public static function FormModesSubscriber::isEditRoute 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::isEditRoute()

Evaluate if current context is edit.

Parameters

\Symfony\Component\Routing\Route $route: The route object of entity.

Return value

bool True if current route context is edit or False if not.

2 calls to FormModesSubscriber::isEditRoute()
FormAlter::userRegistrationPasswordFormAlter in src/FormAlter.php
Applies the user_register_form_alter on form_mode_manager register routes.
FormModesSubscriber::getFormModeRouteDefaults in src/Routing/EventSubscriber/FormModesSubscriber.php
Get defaults parameters needed to build Form Mode Manager routes.

File

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

Class

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

Namespace

Drupal\form_mode_manager\Routing\EventSubscriber

Code

public static function isEditRoute(Route $route) {
  return (bool) preg_match_all(self::ROUTE_PATH_CONTEXT_REGEX, $route
    ->getPath(), $matches, PREG_SET_ORDER, 0);
}