class BlockRenderer (View source)

This class can take either an Editor or a Cms array of data to render.

Based on the input it will build a rendering array (nested) based on the block classes.

A block class list may look like this:

TwoColumnsBlock
 ->children: [
     TextBlock: [
         ActionBlock
     ]
     ImageBlock: [
     ]
 ]

Properties

Block[] $rootBlocks

A list of root blocks.

bool $inEditor

Methods

__construct(array $data)

No description

string
render(array $blockViewMappings = [], array $data = [])

No description

static BlockRenderer
fromCmsArray(array $data)

No description

mixed
__get(string $name)

No description

array
toArray()

No description

Details

__construct(array $data)

No description

Parameters

array $data

string render(array $blockViewMappings = [], array $data = [])

No description

Parameters

array $blockViewMappings
array $data

Return Value

string

static BlockRenderer fromCmsArray(array $data)

No description

Parameters

array $data

Return Value

BlockRenderer

mixed __get(string $name)

No description

Parameters

string $name

Return Value

mixed

array toArray()

No description

Return Value

array