Region
extends Model
in package
implements
RegionInterface
Class for a region inside a theme
Interfaces, Classes and Traits
- RegionInterface
- Regions are defined by themes, and are assigned to layouts. They can have blocks.
Table of Contents
- $handle : string
- $layout : LayoutInterface
- $name : string
- $width : string
- $_blocks : array<string|int, BlockInterface>
- addBlock() : mixed
- Add a block to this region
- beforeRender() : bool
- Callback before rendering, returning false will skip the region rendering
- getBlocks() : array<string|int, BlockInterface>
- Blocks getter
- getTemplates() : array<string|int, string>
- Get available templates
- getTheme() : ThemeInterface
- Theme getter
- getVisibleBlocks() : array<string|int, BlockInterface>
- Get visible blocks
- hasBlocks() : bool
- Does this region have blocks
- hasVisibleBlocks() : bool
- Does this region have visible blocks
- render() : Markup
- Render this region
- setBlocks() : mixed
- Blocks setter
Properties
$handle
public
string
$handle
= ''
$layout
public
LayoutInterface
$layout
$name
public
string
$name
= ''
$width
public
string
$width
= '100%'
$_blocks
protected
array<string|int, BlockInterface>
$_blocks
Methods
addBlock()
Add a block to this region
public
addBlock(BlockInterface $block) : mixed
Parameters
- $block : BlockInterface
Tags
Return values
mixed —beforeRender()
Callback before rendering, returning false will skip the region rendering
public
beforeRender() : bool
Tags
Return values
bool —getBlocks()
Blocks getter
public
getBlocks() : array<string|int, BlockInterface>
Tags
Return values
array<string|int, BlockInterface> —getTemplates()
Get available templates
public
getTemplates(LayoutInterface $layout) : array<string|int, string>
Parameters
- $layout : LayoutInterface
Tags
Return values
array<string|int, string> —getTheme()
Theme getter
public
getTheme() : ThemeInterface
Tags
Return values
ThemeInterface —getVisibleBlocks()
Get visible blocks
public
getVisibleBlocks() : array<string|int, BlockInterface>
Tags
Return values
array<string|int, BlockInterface> —hasBlocks()
Does this region have blocks
public
hasBlocks() : bool
Tags
Return values
bool —hasVisibleBlocks()
Does this region have visible blocks
public
hasVisibleBlocks() : bool
Tags
Return values
bool —render()
Render this region
public
render() : Markup
Tags
Return values
Markup —setBlocks()
Blocks setter
public
setBlocks(array<string|int, mixed>|null $blocks) : mixed
Parameters
- $blocks : array<string|int, mixed>|null