FieldDisplayerInterface
extends
DisplayerInterface
in
A displayer renders one and one only type of field, it can have options.
Table of Contents
- CACHE_PREFIX = 'field'
- Prefix used when caching this type of displayers
- beforeRender() : bool
- Callback before rendering, returning false will skip the field rendering.
- eagerLoad() : array<string|int, string>
- Modify eager load map
- getCanBeCached() : bool
- Can this displayer be cached
- getDescription() : string
- Description/helper shown in CP
- getField() : FieldInterface
- Field getter
- getFieldTargets() : array<string|int, string>
- Field classes this displayer can handle.
- getHandle() : string
- Get handle
- getHasOptions() : bool
- Does this displayer define options
- getName() : string
- Get name
- getOptions() : FieldDisplayerOptions
- Get options
- getTheme() : ThemeInterface
- Theme getter
- isDefault() : bool
- Is this displayer the default for a field class
- setField() : mixed
- Field setter
- setOptions() : mixed
- Options setter
Constants
CACHE_PREFIX
Prefix used when caching this type of displayers
public
mixed
CACHE_PREFIX
= 'field'
Methods
beforeRender()
Callback before rendering, returning false will skip the field rendering.
public
beforeRender( &$value) : bool
The value will be null when this is called for a cached content block.
Parameters
Return values
bool —eagerLoad()
Modify eager load map
public
eagerLoad(array<string|int, string> $eagerLoad[, string $prefix = '' ], int $level) : array<string|int, string>
Parameters
- $eagerLoad : array<string|int, string>
- $prefix : string = ''
- $level : int
Return values
array<string|int, string> —getCanBeCached()
Can this displayer be cached
public
getCanBeCached() : bool
Return values
bool —getDescription()
Description/helper shown in CP
public
getDescription() : string
Return values
string —getField()
Field getter
public
getField() : FieldInterface
Return values
FieldInterface —getFieldTargets()
Field classes this displayer can handle.
public
static getFieldTargets() : array<string|int, string>
Developers should use FieldDisplayerService::getFieldTargets($displayerHandle) instead.
Return values
array<string|int, string> —getHandle()
Get handle
public
static getHandle() : string
Return values
string —getHasOptions()
Does this displayer define options
public
getHasOptions() : bool
Return values
bool —getName()
Get name
public
getName() : string
Return values
string —getOptions()
Get options
public
getOptions() : FieldDisplayerOptions
Return values
FieldDisplayerOptions —getTheme()
Theme getter
public
getTheme() : ThemeInterface
Return values
ThemeInterface —isDefault()
Is this displayer the default for a field class
public
static isDefault(string $fieldClass) : bool
Parameters
- $fieldClass : string
Return values
bool —setField()
Field setter
public
setField(FieldInterface $field) : mixed
Parameters
- $field : FieldInterface
Return values
mixed —setOptions()
Options setter
public
setOptions(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>