public function post_index() { $new = new MODEL(); $new->save(); $response = array('success' => true, 'data' => array('id' => $new->id)); $json = json_encode($response); return $json; }
public function action_index() { $record = new MODEL(); SAVE_FIELDS; $record->save(); $array = array('success' => 'true', 'msg' => 'Record added successfully'); $json = json_encode($array); return $json; }
public function post_index() { $data = file_get_contents('php://input'); $temp = json_decode($data); $new = new MODEL(); $new->DEFAULT_FIELD = $temp->text; $new->PARENT_ID = $temp->parentId; $new->LEAF = $temp->leaf; $new->save(); $response = array('success' => true, 'data' => array('id' => $new->id)); $json = json_encode($response); return $json; }