API / Minn\Blocks / Serializer

Serializer final class

Minn\Blocks\Serializer · public/minn/src/Minn/Blocks/Serializer.php · 46 lines

Parsed blocks back to markup. A core block is written by its short name; attributes are JSON with every character that could end the comment or open a tag spelled as an escape ("<" "<", "--" "--", a backslash "\"), so a value can never break out of its delimiter.

Uses 2
Used by 1

Public

staticblocks(array $blocks): string#

A list of parsed blocks back to markup, freeform runs as written.

$blockslist<Block>
staticblock(Minn\Blocks\Block $block): string#

One block with its inner blocks, as the delimiter comments the parser reads.

staticdelimited(?string $name, array $attrs, string $content): string#

Content wrapped in a block's delimiters; a block with no content is written self-closing.

staticattributes(array $attrs): string#

Block attributes as the delimiter carries them.