Somebody
Somebody

Reputation: 9645

Zend Framework set view which returns html ready for output

I'm currently working on subscription mail message and have spotted one moment.

To make controller more cleaner i would like to put all html generation inside view script.

I know only render method for such needs, but it outputs script right away.

Thanks

Upvotes: 1

Views: 1074

Answers (1)

homelessDevOps
homelessDevOps

Reputation: 20726

$view = new Zend_View();

// path to your email view or what ever
$view->setScriptPath(APPLICATION_PATH . '/views/emails/');

// put html in this var
$html = $view->render('myview.phtml');

Upvotes: 4

Related Questions