Reputation: 1452
Possible Duplicate:
How to render ZF2 view within JSON response?
I have to update a Zend controller that has set it up as view strategy ViewJsonStrategy.
Usyally I have
$result = new JsonModel($result);
$e->setResult($result);
return $e;
and everything goes well. But for example I need also to render some html. For example:
$result = new JsonModel($result);
if($someFlag)
{
$result = "<html><body>Html message</body>";
}
$e->setResult($result);
return $e;
This does not work at all. How can I do that?
Upvotes: 0
Views: 51