Esempio n. 1
0
 public function post_index()
 {
     $new = new Paintings();
     $new->save();
     $response = array('success' => true, 'data' => array('id' => $new->id));
     $json = json_encode($response);
     return $json;
 }
Esempio n. 2
0
 public function action_index()
 {
     $record = new Paintings();
     $record->topic = $_POST['topic'];
     $record->style = $_POST['style'];
     $record->save();
     $array = array('success' => 'true', 'msg' => 'Record added successfully');
     $json = json_encode($array);
     return $json;
 }