0
我在我的视图中定义了一个名为Student的变量。在我看来,如何将Student对象显示为JSON?如何在Zend Framework中以JSON格式返回Application_Model 1.11
public function previewAction()
{
// ...
$this->view->student = $student;
}
在我preview.phtml观,我有以下几点:
<script>
// this doesn't return the Application_Model as a JSON object in the html
var studentData = <?php echo Zend_Json::encode($this->student); ?>;
</script>
请问这个回报把双引号? – skafandri