2

I have created under application/core folder a file called Auth_controller.php. I am using CodeIgniter 3. php 5.3.3 Centos 6.9

The content is

class Auth_Controller extends CI_Controller{

in config file i declare

$config['subclass_prefix'] = 'Auth_';

Then finally when i called it...

class Home extends Auth_Controller {

it gives me a

Fatal error: Class 'Auth_Controller' not found in /var/www/html/calllist/application/controllers/Home.php on line 3

Message:  Class 'Auth_Controller' not found

3 Answers 3

3

You using $config['subclass_prefix'] = 'Auth_'; settings means you want to extend core CI classes.

If you want to extend CI_Controller then you class name should be Auth_Controller if you want to extend model your class name should be 'Auth_Model'

But Remember those classes/files should be inside your application\core folder

For more details please look at CI documentation

Sign up to request clarification or add additional context in comments.

Comments

1

You need to include Auth_Controller like below mentioned code.

<?php

require_once("secure_area.php");

class Reports extends Secure_area {

Comments

1

The location of Auth_Controller must be in application\core directory. Otherwise you need to manually include class to your controller file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.