class DefaultNegotiator in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Theme/DefaultNegotiator.php \Drupal\Core\Theme\DefaultNegotiator
- 9 core/lib/Drupal/Core/Theme/DefaultNegotiator.php \Drupal\Core\Theme\DefaultNegotiator
Determines the default theme of the site.
Hierarchy
- class \Drupal\Core\Theme\DefaultNegotiator implements \Drupal\Core\Theme\ThemeNegotiatorInterface
Expanded class hierarchy of DefaultNegotiator
1 string reference to 'DefaultNegotiator'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses DefaultNegotiator
File
- core/
lib/ Drupal/ Core/ Theme/ DefaultNegotiator.php, line 11
Namespace
Drupal\Core\ThemeView source
class DefaultNegotiator implements ThemeNegotiatorInterface {
/**
* The system theme config object.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a DefaultNegotiator object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
return TRUE;
}
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
return $this->configFactory
->get('system.theme')
->get('default');
}
}