Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Theme / ThemeInitializationInterface.php
1 <?php
2
3 namespace Drupal\Core\Theme;
4
5 use Drupal\Core\Extension\Extension;
6
7 /**
8  * Defines an interface which contain theme initialization logic.
9  */
10 interface ThemeInitializationInterface {
11
12   /**
13    * Initializes a given theme.
14    *
15    * This loads the active theme, for example include its engine file.
16    *
17    * @param string $theme_name
18    *   The machine name of the theme.
19    *
20    * @return \Drupal\Core\Theme\ActiveTheme
21    *   An active theme object instance for the given theme.
22    */
23   public function initTheme($theme_name);
24
25   /**
26    * Builds an active theme object.
27    *
28    * @param string $theme_name
29    *   The machine name of the theme.
30    *
31    * @return \Drupal\Core\Theme\ActiveTheme
32    *   An active theme object instance for the given theme.
33    *
34    * @throws \Drupal\Core\Theme\MissingThemeDependencyException
35    *   Thrown when base theme for installed theme is not installed.
36    */
37   public function getActiveThemeByName($theme_name);
38
39   /**
40    * Loads a theme, so it is ready to be used.
41    *
42    * Loading a theme includes loading and initializing the engine,
43    * each base theme and its engines.
44    *
45    * @param \Drupal\Core\Theme\ActiveTheme $active_theme
46    *   The theme to load.
47    */
48   public function loadActiveTheme(ActiveTheme $active_theme);
49
50   /**
51    * Builds up the active theme object from extensions.
52    *
53    * @param \Drupal\Core\Extension\Extension $theme
54    *   The theme extension object.
55    * @param \Drupal\Core\Extension\Extension[] $base_themes
56    *   An array of extension objects of base theme and its bases. It is ordered
57    *   by 'next parent first', meaning the top level of the chain will be first.
58    *
59    * @return \Drupal\Core\Theme\ActiveTheme
60    *   The active theme instance for the passed in $theme.
61    */
62   public function getActiveTheme(Extension $theme, array $base_themes = []);
63
64 }