Craft Themes (3.x)

Group extends DisplayItem
in package
implements GroupInterface Uses HasDisplays

Class for a group of displays

Interfaces, Classes and Traits

GroupInterface
A group is a type of item, it can contains several displays

Table of Contents

$dateCreated  : DateTime
$dateUpdated  : DateTime
$display_id  : int
$handle  : string
$hidden  : bool
$id  : int
$labelHidden  : bool
$labelVisuallyHidden  : bool
$name  : string
$uid  : string
$visuallyHidden  : bool
$_display  : DisplayInterface
$_displays  : array<string|int, DisplayInterface>
afterValidate()  : mixed
beforeRender()  : bool
Callback before rendering, returning false will skip the group rendering
defineRules()  : array<string|int, mixed>
eagerLoad()  : array<string|int, mixed>
fields()  : mixed
getAllDisplays()  : array<string|int, mixed>
getConfig()  : array<string|int, mixed>
Get project vonfig
getDisplay()  : DisplayInterface|null
Display getter
getDisplayByHandle()  : DisplayInterface|null
getDisplayByUid()  : DisplayInterface|null
getDisplays()  : array<string|int, mixed>
getDisplaysByHandles()  : array<string|int, mixed>
getDisplaysByUids()  : array<string|int, mixed>
getErrors()  : mixed
getHandle()  : string
getLayout()  : LayoutInterface
Layout getter
getName()  : string
getTemplates()  : array<string|int, string>
Get available templates
getType()  : string
getViewMode()  : ViewModeInterface
View mode getter
getVisibleDisplays()  : array<string|int, mixed>
hasErrors()  : mixed
isVisible()  : bool
render()  : Markup
Render this group
setDisplay()  : mixed
Display setter
setDisplays()  : mixed
loadDisplays()  : array<string|int, mixed>

Properties

$handle

public string $handle

$labelVisuallyHidden

public bool $labelVisuallyHidden = false

$_displays

protected array<string|int, DisplayInterface> $_displays

Methods

afterValidate()

public afterValidate() : mixed
Tags
inheritDoc
Return values
mixed

beforeRender()

Callback before rendering, returning false will skip the group rendering

public beforeRender() : bool
Tags
inheritDoc
Return values
bool

defineRules()

public defineRules() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

eagerLoad()

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

fields()

public fields() : mixed
Tags
inheritDoc
Return values
mixed

getAllDisplays()

public getAllDisplays() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

getConfig()

Get project vonfig

public getConfig() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

getDisplayByHandle()

public getDisplayByHandle(string $handle[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : DisplayInterface|null
Parameters
$handle : string
$onlyRoots : bool = true
$onlyVisibles : bool = true
Tags
inheritDoc
Return values
DisplayInterface|null

getDisplayByUid()

public getDisplayByUid(string $uid[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : DisplayInterface|null
Parameters
$uid : string
$onlyRoots : bool = true
$onlyVisibles : bool = true
Tags
inheritDoc
Return values
DisplayInterface|null

getDisplays()

public getDisplays() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

getDisplaysByHandles()

public getDisplaysByHandles(array<string|int, mixed> $handles[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : array<string|int, mixed>
Parameters
$handles : array<string|int, mixed>
$onlyRoots : bool = true
$onlyVisibles : bool = true
Tags
inheritDoc
Return values
array<string|int, mixed>

getDisplaysByUids()

public getDisplaysByUids(array<string|int, mixed> $uids[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : array<string|int, mixed>
Parameters
$uids : array<string|int, mixed>
$onlyRoots : bool = true
$onlyVisibles : bool = true
Tags
inheritDoc
Return values
array<string|int, mixed>

getErrors()

public getErrors([mixed $attribute = null ]) : mixed
Parameters
$attribute : mixed = null
Tags
inheritDoc
Return values
mixed

getHandle()

public getHandle() : string
Tags
inheritDoc
Return values
string

getName()

public getName() : string
Tags
inheritDoc
Return values
string

getTemplates()

Get available templates

public getTemplates() : array<string|int, string>
Tags
inheritDoc
Return values
array<string|int, string>

getType()

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

getVisibleDisplays()

public getVisibleDisplays() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

hasErrors()

public hasErrors([mixed $attribute = null ]) : mixed
Parameters
$attribute : mixed = null
Tags
inheritDoc
Return values
mixed

isVisible()

public isVisible() : bool
Tags
inheritDoc
Return values
bool

render()

Render this group

public render() : Markup
Tags
inheritDoc
Return values
Markup

setDisplays()

public setDisplays(array<string|int, mixed>|null $displays) : mixed
Parameters
$displays : array<string|int, mixed>|null
Tags
inheritDoc
Return values
mixed

loadDisplays()

protected loadDisplays() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

Search results