Craft Themes (3.x)

CreatorService extends Service
in package

Table of Contents

createBlock()  : array<string|int, mixed>
Create a new block class for a theme
createBlockProvider()  : array<string|int, mixed>
Create a new block displayer for a theme
createFieldDisplayer()  : array<string|int, mixed>
Create a new field displayer class for a theme
createFileDisplayer()  : array<string|int, mixed>
Create a new file displayer class for a theme
createTheme()  : array<string|int, mixed>
Create a new 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
getNamespace()  : string
Get the namespace of a theme
getTheme()  : ThemeInterface
Ensure a theme exists
groupsService()  : GroupsService
Get the groups service
layoutService()  : LayoutService
Get the layout service
matrixService()  : MatrixService
Get the matrix service
sanitizeClassName()  : string
Make up a class name from a name and validates it
themesRegistry()  : ThemesRegistry
Get the themes registry
triggerEvent()  : mixed
Triggers an event
validateHandle()  : mixed
Validate a handle
viewModesService()  : ViewModeService
Get the view mode service
viewService()  : ViewService
Get the view service

Methods

createBlock()

Create a new block class for a theme

public createBlock(string $theme, string $name[, string $handle = '' ][, string $description = '' ][, string $className = '' ]) : array<string|int, mixed>
Parameters
$theme : string
$name : string
$handle : string = ''
$description : string = ''
$className : string = ''
Return values
array<string|int, mixed>

createBlockProvider()

Create a new block displayer for a theme

public createBlockProvider(string $theme, string $name[, string $handle = '' ][, string $className = '' ]) : array<string|int, mixed>
Parameters
$theme : string
$name : string
$handle : string = ''
$className : string = ''
Return values
array<string|int, mixed>

createFieldDisplayer()

Create a new field displayer class for a theme

public createFieldDisplayer(string $theme, string $name[, string $handle = '' ][, string $className = '' ]) : array<string|int, mixed>
Parameters
$theme : string
$name : string
$handle : string = ''
$className : string = ''
Return values
array<string|int, mixed>

createFileDisplayer()

Create a new file displayer class for a theme

public createFileDisplayer(string $theme, string $name[, string $handle = '' ][, string $className = '' ]) : array<string|int, mixed>
Parameters
$theme : string
$name : string
$handle : string = ''
$className : string = ''
Return values
array<string|int, mixed>

createTheme()

Create a new theme

public createTheme(string $name[, string $handle = '' ][, string $namespace = '' ][, string $className = '' ][, string $folder = 'themes' ]) : array<string|int, mixed>
Parameters
$name : string
$handle : string = ''
$namespace : string = ''
$className : string = ''
$folder : string = 'themes'
Tags
throws
CreatorException
Return values
array<string|int, mixed>

matrixService()

Get the matrix service

protected matrixService() : MatrixService
Return values
MatrixService

sanitizeClassName()

Make up a class name from a name and validates it

protected sanitizeClassName(string $className, string $name) : string
Parameters
$className : string
$name : string
Tags
throws
CreatorException
Return values
string

triggerEvent()

Triggers an event

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

validateHandle()

Validate a handle

protected validateHandle(string $handle) : mixed
Parameters
$handle : string
Tags
throws
CreatorException
Return values
mixed

Search results