Welcome Guest, Not a member yet? Register   Sign In
Multiple Core Controllers
#1

I have asked this question in https://forum.codeigniter.com/thread-67845-page-2.html here
but nobody responded. so I created new thread for this problem:

I have tried to implement Phil Sturgeon's Rest Server:

in application/config.php:

PHP Code:
$config['subclass_prefix'] = 'MY_';


function 
__autoload($class)
{

 if(
strpos($class'CI_') !== 0)
 {
 @include_once( 
APPPATH 'core/'$class EXT );
 }


in application/core/MY_Controller.php
PHP Code:
class MY_Controller extends CI_Controller{

 function 
__construct()
 {

 
parent::__construct();

 
   }


in application/core/Rest_Controller.php
PHP Code:
abstract class Rest_Controller extends MY_Controller {
 
   public function __construct($config 'rest')
 
   {
 
          parent::__construct();
 
           ....
 
          }


in application/Auth.php
Code:
class Auth extends Rest_Controller{

function __construct()
{
           parent::__construct();
       }
}

I am getting Class 'Rest_Controller' not found error in Auth php at line: class Auth extends Rest_Controller.
#2

See https://github.com/jedi-academy/package-restful for working example




Theme © iAndrew 2016 - Forum software by © MyBB