Thsi does not seem to work:
$msg="Your changes have been saved successfully";
$view=include('application/view/admin/cms/_slides-current.php');
$return_array=array('success'=>true, 'msg'=>$msg, 'view'=>$view);
echo json_encode($return_array);
The array needs to be passed back to a jQuery ajax success callback. Anybody know how it should be done?
The include file is simply a HTML template. This HTML template will be inserted on to the page.
Is there any way other than using json_encode() to do what I am trying to do?
success: function(result){
alert(result.msg);
if(result.success == true)
{
$('#slides').html(result.view);
}
}