I have two functions within a controller. Action which it loaded after calling the controller indexAction()
and private function which sets data to view called generateInvoice($id)
.
public function indexAction() {
$this->generateInvoice('48313');
var_dump($this->view->tax); // prints tax, view has desired data
$htmlcontent = $this->view->render();
$this->setNoRender();
var_dump($htmlcontent); // returns string '' (length=0)
}
private function generateInvoice($id) {
$this->view->id = $id;
$this->view->other_variables = $their_values;
...
}
After calling this, Zend var dumps me just an empty string. However, when I remove $this->setNoRender();
, my index.phtml file is loaded and everything renders just fine - unfortunately, not into my variable, but it gets printed on the screen, which I don't want.
I didn't find any hint online, why $htmlcontent = $this->view->render();
doesn't work in my case. Any ideas?