class DxprThemeSettingsThemeNegotiator in DXPR Theme Helper 1.0.x
Forces theme settings forms to use the Theme that is being configured
Hierarchy
- class \Drupal\dxpr_theme_helper\Theme\DxprThemeSettingsThemeNegotiator implements ThemeNegotiatorInterface
Expanded class hierarchy of DxprThemeSettingsThemeNegotiator
1 string reference to 'DxprThemeSettingsThemeNegotiator'
1 service uses DxprThemeSettingsThemeNegotiator
File
- src/
Theme/ DxprThemeSettingsThemeNegotiator.php, line 11
Namespace
Drupal\dxpr_theme_helper\ThemeView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DxprThemeSettingsThemeNegotiator:: |
public | function |
Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface:: |
|
DxprThemeSettingsThemeNegotiator:: |
public | function |
Determine the active theme for the request. Overrides ThemeNegotiatorInterface:: |