ThemesRegistry
extends Service
in package
Table of Contents
- EVENT_THEME_SET = 'themes.set'
- $rootsRegistered : bool
- Have the template roots been registered
- $currentTheme : ThemeInterface|null
- $themes : array<string|int, ThemeInterface>
- getAll() : array<string|int, ThemeInterface>
- Get all themes
- getAsNames() : array<string|int, string>
- Get all themes as names
- getCurrent() : ThemeInterface|null
- Get theme for the current site
- getDependencies() : array<string|int, ThemeInterface>
- Get all themes that depends on a theme
- getNonPartials() : array<string|int, ThemeInterface>|array<string|int, string>|array<string|int, array<string|int, mixed>>
- Get all non partial themes
- getTheme() : ThemeInterface
- Get a theme by handle
- hasTheme() : bool
- Does a theme exist
- isInstalled() : bool
- Is a theme's data installed (layouts, displays etc) This is tracked through the project config 'plugins.themes.themesInstalled' array
- registerCurrentThemeBundles() : mixed
- Register the asset bundles of the current theme
- registerCurrentThemeTemplates() : mixed
- Register the current theme templates
- resetThemes() : mixed
- Reset themes internal cache
- setCurrent() : ThemeInterface|null
- Sets current theme
- blockCacheService() : BlockCacheService
- Get the block cache service
- blockProviderService() : BlockProvidersService
- Get the block providers service
- blocksService() : BlockService
- Get the blocks service
- displayService() : DisplayService
- Get the display service
- eagerLoadingService() : EagerLoadingService
- Get the eager loading service
- fieldDisplayersService() : FieldDisplayerService
- Get the field displayers service
- fieldsService() : FieldsService
- Get the fields service
- fileDisplayerService() : FileDisplayerService
- Get the file displayers service
- groupsService() : GroupsService
- Get the groups service
- layoutService() : LayoutService
- Get the layout service
- loadThemes() : mixed
- Loads all themes from the list of plugins
- matrixService() : MatrixService
- Get the matrix service
- themesRegistry() : ThemesRegistry
- Get the themes registry
- triggerEvent() : mixed
- Triggers an event
- viewModesService() : ViewModeService
- Get the view mode service
- viewService() : ViewService
- Get the view service
Constants
EVENT_THEME_SET
public
mixed
EVENT_THEME_SET
= 'themes.set'
Properties
$rootsRegistered
Have the template roots been registered
public
bool
$rootsRegistered
= false
$currentTheme
protected
ThemeInterface|null
$currentTheme
$themes
protected
array<string|int, ThemeInterface>
$themes
Methods
getAll()
Get all themes
public
getAll() : array<string|int, ThemeInterface>
Return values
array<string|int, ThemeInterface> —getAsNames()
Get all themes as names
public
getAsNames() : array<string|int, string>
Return values
array<string|int, string> —getCurrent()
Get theme for the current site
public
getCurrent() : ThemeInterface|null
Return values
ThemeInterface|null —getDependencies()
Get all themes that depends on a theme
public
getDependencies(ThemeInterface $theme) : array<string|int, ThemeInterface>
Parameters
- $theme : ThemeInterface
Return values
array<string|int, ThemeInterface> —getNonPartials()
Get all non partial themes
public
getNonPartials([bool $asNames = false ][, bool $asArrays = false ]) : array<string|int, ThemeInterface>|array<string|int, string>|array<string|int, array<string|int, mixed>>
Parameters
- $asNames : bool = false
- $asArrays : bool = false
Return values
array<string|int, ThemeInterface>|array<string|int, string>|array<string|int, array<string|int, mixed>> —getTheme()
Get a theme by handle
public
getTheme(string $handle) : ThemeInterface
Parameters
- $handle : string
Tags
Return values
ThemeInterface —hasTheme()
Does a theme exist
public
hasTheme(string $handle) : bool
Parameters
- $handle : string
Return values
bool —isInstalled()
Is a theme's data installed (layouts, displays etc) This is tracked through the project config 'plugins.themes.themesInstalled' array
public
isInstalled(ThemeInterface $theme) : bool
Parameters
- $theme : ThemeInterface
Return values
bool —registerCurrentThemeBundles()
Register the asset bundles of the current theme
public
registerCurrentThemeBundles() : mixed
Return values
mixed —registerCurrentThemeTemplates()
Register the current theme templates
public
registerCurrentThemeTemplates(RegisterTemplateRootsEvent $event) : mixed
Parameters
- $event : RegisterTemplateRootsEvent
Return values
mixed —resetThemes()
Reset themes internal cache
public
resetThemes() : mixed
Return values
mixed —setCurrent()
Sets current theme
public
setCurrent(string|ThemeInterface|null $theme) : ThemeInterface|null
Parameters
- $theme : string|ThemeInterface|null
Return values
ThemeInterface|null —blockCacheService()
Get the block cache service
protected
blockCacheService() : BlockCacheService
Return values
BlockCacheService —blockProviderService()
Get the block providers service
protected
blockProviderService() : BlockProvidersService
Return values
BlockProvidersService —blocksService()
Get the blocks service
protected
blocksService() : BlockService
Return values
BlockService —displayService()
Get the display service
protected
displayService() : DisplayService
Return values
DisplayService —eagerLoadingService()
Get the eager loading service
protected
eagerLoadingService() : EagerLoadingService
Return values
EagerLoadingService —fieldDisplayersService()
Get the field displayers service
protected
fieldDisplayersService() : FieldDisplayerService
Return values
FieldDisplayerService —fieldsService()
Get the fields service
protected
fieldsService() : FieldsService
Return values
FieldsService —fileDisplayerService()
Get the file displayers service
protected
fileDisplayerService() : FileDisplayerService
Return values
FileDisplayerService —groupsService()
Get the groups service
protected
groupsService() : GroupsService
Return values
GroupsService —layoutService()
Get the layout service
protected
layoutService() : LayoutService
Return values
LayoutService —loadThemes()
Loads all themes from the list of plugins
protected
loadThemes() : mixed
Return values
mixed —matrixService()
Get the matrix service
protected
matrixService() : MatrixService
Return values
MatrixService —themesRegistry()
Get the themes registry
protected
themesRegistry() : ThemesRegistry
Return values
ThemesRegistry —triggerEvent()
Triggers an event
protected
triggerEvent(string $type, Event $event) : mixed
Parameters
- $type : string
- $event : Event
Return values
mixed —viewModesService()
Get the view mode service
protected
viewModesService() : ViewModeService
Return values
ViewModeService —viewService()
Get the view service
protected
viewService() : ViewService