Basically, I want to render a view and layout from a model. Don't ask me why.
First of all, the views work as intended and I'm loading them into a variable for my perverse use later on. I am also fully aware that I could always do partial scripts. It seems to be a valid fallback, but it just doesn't cut it.
What I want to do is to get the layout to work automatically just like in the case with controllers and views.
Right now I employ something like this:
// Class blablabla
$layout = new Zend_Layout();
$layout->enableLayout();
$layout->setView($view);
// Ugly url, I know, I'm experimenting and they work
$body = $layout->render('mailer/layout/mail');
$body .= $view->render('mailer/templates/' . $type . '.phtml');
The problem is that $body contains the layout and only then the actual view. Any advice? What am I doing wrong?