Hi there,
On my page I am using blocks and in a controller on a certain page I need to do some parsing for each block and store the parsed values within the block somehow to later use it in my template. I have no idea how to properly do this.
Ideally I would like to set it up in a way, so I can use it like this in my template:
<?php foreach ($blocks as $block): ?>
<p>My parsed value: <?= $block->parsedValue() ?></p>
<?php endforeach ?>
where parsedValue()
is a virtual field, i.e. a field that does not exist in the block’s blueprint.
Can anyone help me achieve this?
Thanks a lot!
trych