class ThemeStream
Defines the read-only theme:// stream wrapper for theme files.
Only enabled themes are supported.
Example Usage:
theme:
//my_theme/css/component.cssPoints to the component.css file in the theme my_theme's css directory.
Hierarchy
- class \Drupal\Core\StreamWrapper\LocalStream implements \Drupal\Core\StreamWrapper\StreamWrapperInterface
- class \Drupal\Core\StreamWrapper\LocalReadOnlyStream extends \Drupal\Core\StreamWrapper\LocalStream
- class \Drupal\Core\StreamWrapper\ExtensionStreamBase extends \Drupal\Core\StreamWrapper\LocalReadOnlyStream
- class \Drupal\Core\StreamWrapper\ThemeStream extends \Drupal\Core\StreamWrapper\ExtensionStreamBase
- class \Drupal\Core\StreamWrapper\ExtensionStreamBase extends \Drupal\Core\StreamWrapper\LocalReadOnlyStream
- class \Drupal\Core\StreamWrapper\LocalReadOnlyStream extends \Drupal\Core\StreamWrapper\LocalStream
Expanded class hierarchy of ThemeStream
1 file declares its use of ThemeStream
- ExtensionStreamTest.php in core/
tests/ Drupal/ KernelTests/ Core/ StreamWrapper/ ExtensionStreamTest.php
1 string reference to 'ThemeStream'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses ThemeStream
File
-
core/
lib/ Drupal/ Core/ StreamWrapper/ ThemeStream.php, line 21
Namespace
Drupal\Core\StreamWrapperView source
final class ThemeStream extends ExtensionStreamBase {
/**
* {@inheritdoc}
*/
public function getName() : TranslatableMarkup {
return new TranslatableMarkup('Theme files');
}
/**
* {@inheritdoc}
*/
public function getDescription() : TranslatableMarkup {
return new TranslatableMarkup("Local files stored under a theme's directory.");
}
/**
* {@inheritdoc}
*/
protected function getExtension(string $extension_name) : Extension {
return \Drupal::service('theme_handler')->getTheme($extension_name);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.