Have you tried using the render() method on a
renderer<http://framework.zend.com/manual/2.0/en/modules/zend.view.renderer.php-renderer.html>
?
use Zend\View\Model\ViewModel;use Zend\View\Renderer\PhpRenderer;
$renderer = new PhpRenderer();
$model = new ViewModel();$model->setVariable('foo', 'bar');
$model->setTemplate($templateName);$renderer->render($model);
On Tue, May 27, 2014 at 6:12 PM, dennis-fedco <[email protected]>wrote:
> 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.
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/How-to-render-ViewModel-immediately-preventing-future-events-tp4662096.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>