Craft Themes (3.x)

FieldDisplayerService extends Service
in package

Table of Contents

EVENT_DEFAULT_DISPLAYER  = 'default_displayer'
EVENT_FIELD_TARGETS  = 'field_targets'
EVENT_REGISTER_DISPLAYERS  = 'register_displayers'
$_defaults  : array<string|int, mixed>
Defaults displayers, indexed by field class
$_displayers  : array<string|int, string>
All displayers classes, indexed by handle
$_fieldTargets  : array<string|int, mixed>
Field targets, indexed by displayer handle
ensureDisplayerIsValidForField()  : mixed
Ensure a displayer handle is valid for a field class
getAll()  : array<string|int, string>
Displayers getter
getAvailable()  : array<string|int, FieldDisplayerInterface>
Get available displayers for a field
getByHandle()  : FieldDisplayerInterface
Get a displayer by handle
getClassByHandle()  : string
Get a displayer class by handle
getDefaultHandle()  : string|null
Get the default displayer handle for a field class
getFieldTargets()  : array<string|int, string>
Get the field targets for a displayer handle
hasDisplayer()  : bool
Does a displayer handle exists
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
ensureDisplayerIsDefined()  : mixed
Ensures a displayer handle is defined
fieldDisplayersService()  : FieldDisplayerService
Get the field displayers service
fieldsService()  : FieldsService
Get the fields service
fileDisplayerService()  : FileDisplayerService
Get the file displayers service
getByHandles()  : array<string|int, FieldDisplayerInterface>
Get many displayers, by handle
groupsService()  : GroupsService
Get the groups service
layoutService()  : LayoutService
Get the layout service
matrixService()  : MatrixService
Get the matrix service
register()  : mixed
Registers field displayers
registerDefault()  : mixed
Register default displayer handle for a field class
registerTargets()  : mixed
Register field targets for a displayer handle
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

$_defaults

Defaults displayers, indexed by field class

protected array<string|int, mixed> $_defaults = []

$_displayers

All displayers classes, indexed by handle

protected array<string|int, string> $_displayers

$_fieldTargets

Field targets, indexed by displayer handle

protected array<string|int, mixed> $_fieldTargets = []

Methods

ensureDisplayerIsValidForField()

Ensure a displayer handle is valid for a field class

public ensureDisplayerIsValidForField(string $displayerHandle, string $fieldClass) : mixed
Parameters
$displayerHandle : string
$fieldClass : string
Tags
throws
FieldDisplayerException
Return values
mixed

getAll()

Displayers getter

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

getDefaultHandle()

Get the default displayer handle for a field class

public getDefaultHandle(string $classFor) : string|null
Parameters
$classFor : string
Return values
string|null

getFieldTargets()

Get the field targets for a displayer handle

public getFieldTargets(string $displayerHandle) : array<string|int, string>
Parameters
$displayerHandle : string
Return values
array<string|int, string>

hasDisplayer()

Does a displayer handle exists

public hasDisplayer(string $handle) : bool
Parameters
$handle : string
Return values
bool

ensureDisplayerIsDefined()

Ensures a displayer handle is defined

protected ensureDisplayerIsDefined(string $handle) : mixed
Parameters
$handle : string
Tags
throws
FieldDisplayerException
Return values
mixed

matrixService()

Get the matrix service

protected matrixService() : MatrixService
Return values
MatrixService

registerDefault()

Register default displayer handle for a field class

protected registerDefault(string $fieldClass) : mixed
Parameters
$fieldClass : string
Return values
mixed

registerTargets()

Register field targets for a displayer handle

protected registerTargets(string $displayerHandle) : mixed
Parameters
$displayerHandle : string
Return values
mixed

triggerEvent()

Triggers an event

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

Search results