I have a problem with the popular REST API controller supported by Chris Kacerguis. I imported the three files Format.php, REST_Controller.php and rest.php and placed them in the appropriate places in my codeIgniter file structure. I created a User controller that looks like this:
<?php
require_once APPPATH.'libraries/REST_Controller.php';
class Users extends REST_Controller{
public function index_get()
{
$this->response("Get method");
}
public function index_post()
{
$this->response("Post method");
}
}
?>
I keep getting an error: "Class" REST_Controller "not found" when I go to my endpoint: http: //localhost/api_test/index.php/users
Any idea what I'm doing wrong?
source
share