Craft Themes (3.x)

GroupInterface extends HasDisplaysInterface

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

Table of Contents

beforeRender()  : bool
Callback before rendering, returning false will skip the group rendering
getAllDisplays()  : array<string|int, DisplayInterface>
Returns all displays, in groups or not
getDisplayByHandle()  : DisplayInterface|null
Fetch a display by handle Returns a field or a group type of display
getDisplayByUid()  : DisplayInterface|null
Fetch a display by uid Returns a field or a group type of display
getDisplays()  : array<string|int, DisplayInterface>
Displays getter, will only fetch the root displays (that aren't in groups)
getDisplaysByHandles()  : array<string|int, DisplayInterface>
Fetch displays by handles
getDisplaysByUids()  : array<string|int, DisplayInterface>
Fetch displays by uids
getTemplates()  : array<string|int, string>
Get available templates
getVisibleDisplays()  : array<string|int, DisplayInterface>
Get all visible displays
render()  : Markup
Render this group
setDisplays()  : mixed
Display setter

Methods

beforeRender()

Callback before rendering, returning false will skip the group rendering

public beforeRender() : bool
Return values
bool

getDisplayByHandle()

Fetch a display by handle Returns a field or a group type of display

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

Only look at root displays (not in groups)

$onlyVisibles : bool = true

Only look at visible displays

Return values
DisplayInterface|null

getDisplayByUid()

Fetch a display by uid Returns a field or a group type of display

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

Only look at root displays (not in groups)

$onlyVisibles : bool = true

Only look at visible displays

Return values
DisplayInterface|null

getDisplaysByHandles()

Fetch displays by handles

public getDisplaysByHandles(array<string|int, string> $handles[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : array<string|int, DisplayInterface>
Parameters
$handles : array<string|int, string>
$onlyRoots : bool = true

Only look at root displays (not in groups)

$onlyVisibles : bool = true

Only look at visible displays

Return values
array<string|int, DisplayInterface>

getDisplaysByUids()

Fetch displays by uids

public getDisplaysByUids(array<string|int, string> $uids[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : array<string|int, DisplayInterface>
Parameters
$uids : array<string|int, string>
$onlyRoots : bool = true

Only look at root displays (not in groups)

$onlyVisibles : bool = true

Only look at visible displays

Return values
array<string|int, DisplayInterface>

getTemplates()

Get available templates

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

render()

Render this group

public render() : Markup
Return values
Markup

Search results