I am integrating the CodeIgniter Rest Server
library, but it does not work for me, someone could guide me correctly, I only copied the files indicated in link , but it does not work yet.
Copy the application/libraries/Format.php
and application/libraries/REST_Controller.php
files into the libraries
folder of my project.
Also copy the application/config/rest.php
file into my config
folder.
Then create the Restserver driver:
defined('BASEPATH') OR exit('No direct script access allowed');
use Restserver\Libraries\REST_Controller;
class Restserver extends REST_Controller {
public function __construct() {
parent::__construct();
$this->load->database();
$this->load->helper('url');
}
}
Then add the method to list the products:
public function products_get() {
$this->load->model('products_model');
$this->response($this->products_model>getproducts());
}
But when loading the page, I get error 500.