Craft Themes (3.x)

FileDisplayer extends Model
in package
implements FileDisplayerInterface

Base class for all file displayers

Interfaces, Classes and Traits

FileDisplayerInterface
A file displayer renders an asset. It can handle several file kinds

Table of Contents

$_displayer  : FieldDisplayerInterface
$_options  : FileDisplayerOptions
beforeRender()  : bool
Callback before rendering, returning false will skip the file rendering
eagerLoad()  : array<string|int, mixed>
fields()  : mixed
getCanBeCached()  : bool
getDescription()  : string
getDisplayer()  : FieldDisplayerInterface
Displayer getter
getField()  : FieldInterface
getHandle()  : string
getHasOptions()  : bool
getOptions()  : Model
Get options
getTheme()  : ThemeInterface
Get theme associated to this displayer
isDefault()  : bool
Is this displayer the default for an asset kind
setDisplayer()  : mixed
Displayer setter
getOptionsModel()  : string
Get options model class

Properties

Methods

beforeRender()

Callback before rendering, returning false will skip the file rendering

public beforeRender(Asset $asset) : bool
Parameters
$asset : Asset
Tags
inheritDoc
Return values
bool

eagerLoad()

public eagerLoad(array<string|int, mixed> $eagerLoad[, string $prefix = '' ], int $level) : array<string|int, mixed>
Parameters
$eagerLoad : array<string|int, mixed>
$prefix : string = ''
$level : int
Tags
inheritDoc
Return values
array<string|int, mixed>

fields()

public fields() : mixed
Tags
inheritDoc
Return values
mixed

getCanBeCached()

public getCanBeCached() : bool
Tags
inheritDoc
Return values
bool

getDescription()

public getDescription() : string
Tags
inheritDoc
Return values
string

getHandle()

public static getHandle() : string
Tags
inheritDoc
Return values
string

getHasOptions()

public getHasOptions() : bool
Tags
inheritDoc
Return values
bool

getOptions()

Get options

public getOptions() : Model
Tags
inheritDoc
Return values
Model

getTheme()

Get theme associated to this displayer

public getTheme() : ThemeInterface
Return values
ThemeInterface

isDefault()

Is this displayer the default for an asset kind

public static isDefault(string $kind) : bool
Parameters
$kind : string
Tags
inheritDoc
Return values
bool

getOptionsModel()

Get options model class

protected abstract getOptionsModel() : string
Return values
string

Search results