Hello,
I've got following code in my Controller:
private function checkUpdate($data){
$this->view->disable();
$this->response->setJsonContent($data);
return $this->response;
}
Where $data is array.
And following AJAX call:
$("#checkUpdate").on('click', function() {
$.ajax({
type: "POST",
contentType: "application/json",
url: '/update/data/<?php echo $entry->id; ?>/check',
success: function(response){
$("#updated").show();
console.log(response);
}
});
If I'm not wrong it should work correctly however I've got empty response. When I tried to print $data in controller I've see correct array but it's not send.