Get rendered view within block controller

Permalink 1 user found helpful
Hi!

Is there any chance in my block controller save method, to get the rendered view back as string to work with? I first thought of the display method, but I can't call it from the block controller ...

Thanks
Marcus

 
rge replied on at Permalink Best Answer Reply
You can use Concrete\Core\Block\View\BlockView;

$b = $this->getBlockObject();
$bv = new BlockView($b);


In concrete/src/Area/Area.php in the display method, you can see how it is used in the core. The render method.

Note that the renderViewContents does not return the content but uses echo.
concrete/src/Block/View/BlockView.php
marcusm replied on at Permalink Reply
Thank you