Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Theme / DefaultNegotiator.php
1 <?php
2
3 namespace Drupal\Core\Theme;
4
5 use Drupal\Core\Config\ConfigFactoryInterface;
6 use Drupal\Core\Routing\RouteMatchInterface;
7
8 /**
9  * Determines the default theme of the site.
10  */
11 class DefaultNegotiator implements ThemeNegotiatorInterface {
12
13   /**
14    * The system theme config object.
15    *
16    * @var \Drupal\Core\Config\ConfigFactoryInterface
17    */
18   protected $configFactory;
19
20   /**
21    * Constructs a DefaultNegotiator object.
22    *
23    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
24    *   The config factory.
25    */
26   public function __construct(ConfigFactoryInterface $config_factory) {
27     $this->configFactory = $config_factory;
28   }
29
30   /**
31    * {@inheritdoc}
32    */
33   public function applies(RouteMatchInterface $route_match) {
34     return TRUE;
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   public function determineActiveTheme(RouteMatchInterface $route_match) {
41     return $this->configFactory->get('system.theme')->get('default');
42   }
43
44 }