Argument 1 passed to NotORM_Result::update() must be of the type array, string php slim
From index.php pass data(array) to dbhandler.php
//Update Calendar Status by todo_id (index.php)
$app->get('/TodoUpdateCalendarStatus/:todo_id',function($todo_id) use ($app){
$db =new DbHandler();
$update_data = array(
'calendar_status' => 1
);
$data = $db->TodoUpdateCalendarStatus($todo_id,$update_data);
$app->response()->header('Content-Type', 'application/json');
echo json_encode($data);
});
dbhandler.php
public function TodoUpdateCalendarStatus($tid,$u_data)
{
return $this->db->tbl_todo_master()
->where('todo_master_id = ?', $tid)
->update($u_data);
}
//end