How to return an Application_Model in JSON format in Zend Framework 1.11

Buffer.OverRun

New Member
I define a variable in my view, called Student. In my view, how to I display the Student object as a JSON?\[code\]public function previewAction(){ // ... $this->view->student = $student;}\[/code\]In my preview.phtml view, i have the following:\[code\]<script> // this doesn't return the Application_Model as a JSON object in the html var studentData = http://stackoverflow.com/questions/10553554/<?php echo Zend_Json::encode($this->student); ?>; </script>\[/code\]
 
Back
Top