get('id')) { $this->response(NULL, 400); } // $user = $this->some_model->getSomething( $this->get('id') ); $users = array( 1 => array('id' => 1, 'name' => 'Some Guy', 'email' => 'example1@example.com', 'fact' => 'Loves swimming'), 2 => array('id' => 2, 'name' => 'Person Face', 'email' => 'example2@example.com', 'fact' => 'Has a huge face'), 3 => array('id' => 3, 'name' => 'Scotty', 'email' => 'example3@example.com', 'fact' => 'Is a Scott!'), ); $user = $users[$this->get('id')]; if($user) { $this->response($user, 200); // 200 being the HTTP response code } else { $this->response(NULL, 404); } } function user_post() { //$this->some_model->updateUser( $this->get('id') ); $message = array('id' => $this->get('id'), 'name' => $this->post('name'), 'email' => $this->post('email'), 'message' => 'ADDED!'); $this->response($message, 200); // 200 being the HTTP response code } function user_delete() { //$this->some_model->deletesomething( $this->get('id') ); $message = array('id' => $this->get('id'), 'message' => 'DELETED!'); $this->response($message, 200); // 200 being the HTTP response code } function users_get() { //$users = $this->some_model->getSomething( $this->get('limit') ); $users = array( array('id' => 1, 'name' => 'Some Guy', 'email' => 'example1@example.com'), array('id' => 2, 'name' => 'Person Face', 'email' => 'example2@example.com'), array('id' => 3, 'name' => 'Scotty', 'email' => 'example3@example.com'), ); if($users) { $this->response($users, 200); // 200 being the HTTP response code } else { $this->response(NULL, 404); } } } ?>