I am new in zf2. I have to display list of data from database and add, edit, delete operations using JSON. I am using this code to convert the data into JSON.
public function getList()
{
$results = $this->getAlbumTable()->fetchAll();
$data = array();
foreach($results as $result) {
$data[] = $result;
}
return new JsonModel(array(
'data' => $data,
));
}
But I don't know how to display data from this JSON. I searched and didn't get any correct codes. Please help me.