You are here

public function FormModeThemeNegociator::isApplicable in Form mode manager 8.2

Determine if current route has correct options or use joker parameter.

Parameters

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

Return value

bool TRUE if this negotiator should be used or FALSE.

1 call to FormModeThemeNegociator::isApplicable()
FormModeThemeNegociator::applies in modules/form_mode_theme_switcher/src/Theme/FormModeThemeNegociator.php
Whether this theme negotiator should be used to set the theme.

File

modules/form_mode_theme_switcher/src/Theme/FormModeThemeNegociator.php, line 86

Class

FormModeThemeNegociator
Class FormModeThemeNegociator.

Namespace

Drupal\form_mode_manager_theme_switcher\Theme

Code

public function isApplicable(Route $route) {
  if (!$route
    ->hasOption('_form_mode_manager_entity_type_id')) {
    return FALSE;
  }
  $route_form_mode_theme = $route
    ->getOption('form_mode_theme');
  $form_mode_id = str_replace('.', '_', $route
    ->getDefault('_entity_form'));
  $form_mode_theme_type = $this->formModeThemeSwitcherConfig
    ->get("type.{$form_mode_id}");
  return isset($form_mode_theme_type) || isset($route_form_mode_theme);
}