You are here

class DxprThemeSettingsThemeNegotiator in DXPR Theme Helper 1.0.x

Forces theme settings forms to use the Theme that is being configured

Hierarchy

Expanded class hierarchy of DxprThemeSettingsThemeNegotiator

1 string reference to 'DxprThemeSettingsThemeNegotiator'
dxpr_theme_helper.services.yml in ./dxpr_theme_helper.services.yml
dxpr_theme_helper.services.yml
1 service uses DxprThemeSettingsThemeNegotiator
theme.negotiator.dxpr_theme_settings in ./dxpr_theme_helper.services.yml
Drupal\dxpr_theme_helper\Theme\DxprThemeSettingsThemeNegotiator

File

src/Theme/DxprThemeSettingsThemeNegotiator.php, line 11

Namespace

Drupal\dxpr_theme_helper\Theme
View source
class DxprThemeSettingsThemeNegotiator implements ThemeNegotiatorInterface {

  /**
   * {@inheritdoc}
   */
  public function applies(RouteMatchInterface $route_match) {
    $route = $route_match
      ->getRouteObject();
    return $route && $route
      ->getPath() == '/admin/appearance/settings/{theme}';
  }

  /**
   * {@inheritdoc}
   */
  public function determineActiveTheme(RouteMatchInterface $route_match) {
    $current_theme = $route_match
      ->getParameter('theme');
    return $current_theme;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DxprThemeSettingsThemeNegotiator::applies public function Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface::applies
DxprThemeSettingsThemeNegotiator::determineActiveTheme public function Determine the active theme for the request. Overrides ThemeNegotiatorInterface::determineActiveTheme