BlockTemplateInterface
extends
ContainerInterface
in
Interface for block-based template.
Table of Contents
- generate_block_id() : string
- Generate a block ID based on a base.
- get_area() : string
- Get the template area.
- get_block() : BlockInterface|null
- Get a block by ID.
- get_description() : string
- Get the template description.
- get_formatted_template() : array<string|int, mixed>
- Get the block configuration as a formatted template.
- get_id() : string
- Get the template ID.
- get_root_template() : BlockTemplateInterface
- Get the root template that the block belongs to.
- get_title() : string
- Get the template title.
- remove_block() : mixed
- Removes a block from the container.
- remove_blocks() : mixed
- Removes all blocks from the container.
- to_json() : array<string|int, mixed>
- Get the template as JSON like array.
Methods
generate_block_id()
Generate a block ID based on a base.
public
generate_block_id(string $id_base) : string
Parameters
- $id_base : string
-
The base to use when generating an ID.
Return values
string —get_area()
Get the template area.
public
get_area() : string
Return values
string —get_block()
Get a block by ID.
public
get_block(string $block_id) : BlockInterface|null
Parameters
- $block_id : string
-
The block ID.
Return values
BlockInterface|null —get_description()
Get the template description.
public
get_description() : string
Return values
string —get_formatted_template()
Get the block configuration as a formatted template.
public
get_formatted_template() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_id()
Get the template ID.
public
get_id() : string
Return values
string —get_root_template()
Get the root template that the block belongs to.
public
get_root_template() : BlockTemplateInterface
Return values
BlockTemplateInterface —get_title()
Get the template title.
public
get_title() : string
Return values
string —remove_block()
Removes a block from the container.
public
remove_block(string $block_id) : mixed
Parameters
- $block_id : string
-
The block ID.
Tags
Return values
mixed —remove_blocks()
Removes all blocks from the container.
public
remove_blocks() : mixed
Return values
mixed —to_json()
Get the template as JSON like array.
public
to_json() : array<string|int, mixed>