Created
October 18, 2014 19:16
-
-
Save chriskacerguis/ff272fa3b958d40b5583 to your computer and use it in GitHub Desktop.
endpoint.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | |
require APPPATH.'/libraries/REST_Controller.php'; | |
/** | |
* Class API_Sample | |
*/ | |
class API_Sample extends REST_Controller | |
{ | |
/** | |
* [__construct description] | |
* @author Chris Kacerguis <[email protected]> | |
*/ | |
public function __construct() | |
{ | |
parent::__construct(); | |
} | |
/** | |
* get http method, should be used to simply return data | |
* @author Chris Kacerguis <[email protected]> | |
* @return [type] [description] | |
*/ | |
public function index_get() | |
{ | |
var_dump($this->get()); | |
} | |
/** | |
* post http method, should be used to "create" a record | |
* @author Chris Kacerguis <[email protected]> | |
* @return [type] [description] | |
*/ | |
public function index_post() | |
{ | |
var_dump($this->post()); | |
} | |
/** | |
* put http method, should be used to "update" a record | |
* @author Chris Kacerguis <[email protected]> | |
* @return [type] [description] | |
*/ | |
public function index_put() | |
{ | |
var_dump($this->put()); | |
} | |
/** | |
* delete http method, should be used to "delete" a record | |
* @author Chris Kacerguis <[email protected]> | |
* @return [type] [description] | |
*/ | |
public function index_delete() | |
{ | |
var_dump($this->delete()); | |
} | |
} | |
/* End of file api_sample.php */ | |
/* Location: ./application/controllers/api/api_sample.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment