BlockInterface
in
Defines a block. Blocks are defined by providers, they can have various options and can be assigned to theme's regions.
Table of Contents
- afterSave() : mixed
- Callback after the block has been saved
- beforeRender() : bool
- Callback before rendering, returning false will skip the block rendering.
- getCacheStrategy() : BlockCacheStrategyInterface|null
- Get the cache strategy for this block
- getCanBeCached() : bool
- Can this block be cached
- getConfig() : array<string|int, mixed>
- Project config to be saved
- getHandle() : string
- Get block handle
- getLayout() : LayoutInterface
- Get layout object
- getLongDescription() : string
- Long description getter
- getMachineName() : string
- Get full machine name, in the form provider-handle
- getName() : string
- Name getter
- getOptions() : BlockOptions
- Get options model
- getSmallDescription() : string
- Small description getter
- getTemplates() : array<string|int, string>
- Get available templates
- isVisible() : bool
- Is this block visible
- provider() : BlockProviderInterface
- Get provider object
- render() : Markup
- Render this block
- setCacheStrategy() : mixed
- Set the cache strategy, $strategy should be an array : [ 'handle' => 'strategyHandle', 'options' => [] ]
- setLayout() : mixed
- Set layout object
- setOptions() : mixed
- Options setter
Methods
afterSave()
Callback after the block has been saved
public
afterSave() : mixed
Return values
mixed —beforeRender()
Callback before rendering, returning false will skip the block rendering.
public
beforeRender() : bool
Return values
bool —getCacheStrategy()
Get the cache strategy for this block
public
getCacheStrategy() : BlockCacheStrategyInterface|null
Return values
BlockCacheStrategyInterface|null —getCanBeCached()
Can this block be cached
public
getCanBeCached() : bool
Return values
bool —getConfig()
Project config to be saved
public
getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed> —getHandle()
Get block handle
public
getHandle() : string
Return values
string —getLayout()
Get layout object
public
getLayout() : LayoutInterface
Return values
LayoutInterface —getLongDescription()
Long description getter
public
getLongDescription() : string
Return values
string —getMachineName()
Get full machine name, in the form provider-handle
public
getMachineName() : string
Return values
string —getName()
Name getter
public
getName() : string
Return values
string —getOptions()
Get options model
public
getOptions() : BlockOptions
Return values
BlockOptions —getSmallDescription()
Small description getter
public
getSmallDescription() : string
Return values
string —getTemplates()
Get available templates
public
getTemplates(LayoutInterface $layout) : array<string|int, string>
Parameters
- $layout : LayoutInterface
Return values
array<string|int, string> —isVisible()
Is this block visible
public
isVisible() : bool
Return values
bool —provider()
Get provider object
public
provider() : BlockProviderInterface
Return values
BlockProviderInterface —render()
Render this block
public
render() : Markup
Return values
Markup —setCacheStrategy()
Set the cache strategy, $strategy should be an array : [ 'handle' => 'strategyHandle', 'options' => [] ]
public
setCacheStrategy(array<string|int, mixed> $strategy) : mixed
Parameters
- $strategy : array<string|int, mixed>
Return values
mixed —setLayout()
Set layout object
public
setLayout(LayoutInterface $layout) : mixed
Parameters
- $layout : LayoutInterface
Return values
mixed —setOptions()
Options setter
public
setOptions(string|array<string|int, mixed> $options) : mixed
Parameters
- $options : string|array<string|int, mixed>