Class 'REST_Controller' not found
Whenever I am extending the class. It is showing Class 'REST_Controller' not found
require(APPPATH . 'libraries/REST_Controller.php');
class Db extends \Restserver\Libraries\REST_Controller
That's how i have done it with my class and it works fine.You need to place the rest_controller in application/libraries
only add
use Restserver\Libraries\REST_Controller;
after
require APPPATH . '/libraries/REST_Controller.php';
Fatal error: Class 'Restserver\Libraries\CI_Controller' not found in D:\Server\htdocs\CodeIgniter\application\libraries\REST_Controller.php on line 18
my REST_Controller class doesn't extend CI_Controller and generate error.
Hi @mahipal0015
Just add backslash before CI_Controller.
abstract class REST_Controller extends \CI_Controller {
@farukgaric after adding \slash An Error Was Encountered Non-existent class: Rest_controller???
I solved this issue. Only do you have put this two lines in the controller:
use Restserver\Libraries\REST_Controller;
require(APPPATH . 'libraries/REST_Controller.php');
And the file REST_Controller.php, the first lines like this:
namespace Restserver\Libraries;
use CI_Controller;
use Exception;
use stdClass;
require APPPATH . 'libraries/Format.php';
defined('BASEPATH') OR exit('No direct script access allowed');
Thanks this worked 👍 @BrianDLA
This worked for me too. Thanks a bunch.
Thanks this worked
Solved Completely this Error Non-existent class: Format Thanks BrianDLA