<b>Fatal error</b>: Class 'CI_Myapi' not found in <b>/var/www/castle_invoice_api/system/core/Common.php</b> on line <b>196</b><br />
I have got this error.Please tell me how to resolve this.My code is
application/config/autoload.php
$autoload['libraries'] = array('Myapi');
application/controllers/Main.php
defined('BASEPATH') OR exit('No direct script access allowed');
require APPPATH . '/libraries/REST_Controller.php';
interface MyInterface {
public function disp();
}
class Myadapter extends REST_Controller implements MyInterface {
public function __construct()
{
// Construct the parent class
parent::__construct();
}
public function disp()
{
return 'sample msg';
}
}
class Main extends REST_Controller {
public $client = FALSE;
public function __construct()
{
// Construct the parent class
parent::__construct();
$this->__authenticate();
}
public function index_post()
{
$resp = new stdClass();
$resp->status = false;
$resp->message = 'something went wrong';
$api = $this->Gateway('api1');
$resp->message = $api->disp();
$this->response($resp, 400);
}
private function __authenticate()
{
$this->client = $this->myapi->__authenticate();
}
private function Gateway($type='')
{
switch($type) {
case "api1":
$api = new Myadapter();
return $api;
break;
case "api2":
$api = new Myadapter1();
return $api;
break;
default:
// Do something to log an exception
return false;
break;
}
}
}