Ejemplo n.º 1
0
 public function addCommentAction()
 {
     $post = $this->input->post();
     $fBComment = new FacebookComment();
     $fBComment->post_id = $post['post_id'];
     $fBComment->comments = $post['comment'];
     $fBComment->userip = $_SERVER['REMOTE_ADDR'];
     $fBComment->date_created = strtotime(date("Y-m-d H:i:s"));
     $fBComment->save();
     $result = FacebookComment::findByCId($fBComment->c_id);
     $response = array("comment" => $result[0]->comments, "comment_id" => $result[0]->c_id);
     echo json_encode($response);
 }