ThemeNegotiator
class ThemeNegotiator implements ThemeNegotiatorInterface (View source)
Provides a class which determines the active theme of the page.
It therefore uses ThemeNegotiatorInterface objects which are passed in using the 'theme_negotiator' tag.
Properties
| protected string[] | $negotiators | Holds an array of theme negotiator IDs, sorted by priority. |
|
| protected ThemeAccessCheck | $themeAccess | The access checker for themes. |
|
| protected ClassResolverInterface | $classResolver | The class resolver. |
Methods
__construct(ThemeAccessCheck $theme_access, ClassResolverInterface $class_resolver, array $negotiators)
Constructs a new ThemeNegotiator.
bool
applies(RouteMatchInterface $route_match)
Whether this theme negotiator should be used to set the theme.
string|null
Details
__construct(ThemeAccessCheck $theme_access, ClassResolverInterface $class_resolver, array $negotiators)
Constructs a new ThemeNegotiator.
bool
applies(RouteMatchInterface $route_match)
Whether this theme negotiator should be used to set the theme.
string|null
determineActiveTheme(RouteMatchInterface $route_match)
Determine the active theme for the request.