I am trying to implement REST API from github
In my existing Codeigniter project.
There is a library in which trait is defined. I am trying to use that library "REST_Controller"
In my controller file "Api.php". But I am getting error on the line where is am using the "use" keyword to implement it which says that unable to
Error
**"Trait 'REST_Controller' not found"
class Books extends CI_Controller {
use REST_Controller {
REST_Controller::__construct as private __resTraitConstruct;
}
Import the trait on top of your class in order to be able to use it
use Restserver\Libraries\REST_Controller;
class Books extends CI_Controller {
use REST_Controller {
REST_Controller::__construct as private __resTraitConstruct;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With