How to render ViewModel immediately (preventing future events)
Can I render View/ViewModel immediately?
There was a feature of ZF2 where one could avoid event triggering, or stop any future event triggering or view model rendering and return from that ViewModel() immediately, rendering something to the browser.
What was it?
I am using ViewModel code of ZF2 only and I am not using the entire Framework. So I am looking for a ZF2 way to just render my ViewModel the moment I call it, as part of non-ZF2 application.
use Zend\View\Model\ViewModel;use Zend\View\Renderer\PhpRenderer;
$renderer = new PhpRenderer();
$model = new ViewModel();$model->setVariable('foo', 'bar');