I have this situation where I need to access a global function and normally I will do that in MY_Controller for the normal CodeIgniter. But in this case, I am using a REST server and I noticed that the normal controller must extends REST_Controller to make it functioning.
From my AuthController
<?php defined('BASEPATH') OR exit('No direct script access allowed');
require APPPATH . 'libraries/REST_Controller.php';
class AuthController extends REST_Controller {}
REST_Controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
abstract class REST_Controller extends CI_Controller {}
I want to use MY_Controller
to create a global function that can be accessed by any controller. For example, from AuthController
I want to extend it to MY_Controller
, but by doing so I won't be able to use the REST_Controller
.
Is there any way I can extend to MY_Controller and REST_Controller at once so that I can use both functions from these two controller?