catalinux
catalinux

Reputation: 1452

Multiple view strategy in zend 2

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

Answers (0)

Related Questions