BlockGroup
in package
This class embodies a group of RichText blocks.
This is only for internal use, when a RichText fragment gets rendered as HTML: the first thing that happens is that RichText blocks get grouped together, so that list-items can later be serialized with a
- before and a
Table of Contents
- $blocks : array<string|int, mixed>
- $maybeTag : string
- __construct() : mixed
- Constructs a group of RichText blocks
- addBlock() : mixed
- Adds a block to the group of blocks.
- getBlocks() : array<string|int, mixed>
- Returns the array of BlockInterface objects that are being grouped here
- getTag() : string
- Returns the tag to use if should be (values are either "ul", "ol" or null).
Properties
$blocks
private
array<string|int, mixed>
$blocks
the array of BlockInterface objects that are being grouped here
$maybeTag
private
string
$maybeTag
the tag to use if should be (values are either "ul", "ol" or null)
Methods
__construct()
Constructs a group of RichText blocks
public
__construct(string $maybeTag, array<string|int, mixed> $blocks) : mixed
Parameters
- $maybeTag : string
-
the tag to use if should be (values are either "ul", "ol" or null)
- $blocks : array<string|int, mixed>
-
the array of BlockInterface objects that are being grouped here
Return values
mixed —addBlock()
Adds a block to the group of blocks.
public
addBlock(BlockInterface $block) : mixed
Parameters
- $block : BlockInterface
-
the block to add
Return values
mixed —getBlocks()
Returns the array of BlockInterface objects that are being grouped here
public
getBlocks() : array<string|int, mixed>
Return values
array<string|int, mixed> —the array of BlockInterface objects that are being grouped here
getTag()
Returns the tag to use if should be (values are either "ul", "ol" or null).
public
getTag() : string
Return values
string —the tag to use if should be (values are either "ul", "ol" or null).