Craft Themes (3.x)

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

Properties

$rootsRegistered

Have the template roots been registered

public bool $rootsRegistered = false

Methods

getAsNames()

Get all themes as names

public getAsNames() : array<string|int, string>
Return values
array<string|int, string>

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>>

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

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

triggerEvent()

Triggers an event

protected triggerEvent(string $type, Event $event) : mixed
Parameters
$type : string
$event : Event
Return values
mixed

Search results