ThemeSettings.php 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Drupal\Core\Theme;
  3. use Drupal\Core\Config\ConfigBase;
  4. /**
  5. * Provides a configuration API wrapper for runtime merged theme settings.
  6. *
  7. * Theme settings use configuration for base values but the runtime theme
  8. * settings are calculated based on various site settings and are therefore
  9. * not persisted.
  10. *
  11. * @see theme_get_setting()
  12. */
  13. class ThemeSettings extends ConfigBase {
  14. /**
  15. * The theme of the theme settings object.
  16. *
  17. * @var string
  18. */
  19. protected $theme;
  20. /**
  21. * Constructs a theme settings object.
  22. *
  23. * @param string $theme
  24. * The name of the theme settings object being constructed.
  25. */
  26. public function __construct($theme) {
  27. $this->theme = $theme;
  28. }
  29. /**
  30. * Returns the theme of this theme settings object.
  31. *
  32. * @return string
  33. * The theme of this theme settings object.
  34. */
  35. public function getTheme() {
  36. return $this->theme;
  37. }
  38. /**
  39. * {@inheritdoc}
  40. */
  41. public function getCacheTags() {
  42. return ['rendered'];
  43. }
  44. }