Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:48:30+00:00 2026-06-10T05:48:30+00:00

I am trying to extend a controller with my own class which extends the

  • 0

I am trying to extend a controller with my own class which extends the default CI_Controller class. Except it doesn’t work.

It says it can’t find my sub-class. My subclass is located in application/core and is named My_Control_Panel.

My class that extends on my sub-class:

if (!defined('BASEPATH')) exit('No direct script access allowed');

class Developers extends My_Control_Panel
{
    public function __construct()
    {
        parent::__construct();
        $this->load->helper('form');
        $this->load->helper('url');
        $this->load->database();

        $this->checkIfLoggedIn();
        $this->checkIfAllowedToViewPage();
}

My sub-class:

if (!defined('BASEPATH')) exit('No direct script access allowed');

class My_Control_Panel extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
    }
}

It keeps saying it can’t find my sub-class, while it should work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:48:32+00:00Added an answer on June 10, 2026 at 5:48 am

    you should name your file like this My_Controller.php inside your core folder
    and then you type your code like

    if (!defined('BASEPATH')) exit('No direct script access allowed');
    
    class My_Control_Panel extends CI_Controller
    {
        public function __construct()
        {
            parent::__construct();
        }
    }
    

    and this is the right way to do it in CodeIgniter, not as mentioned in the first answer with the include one ..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to extend the BaseAuthenticate class within CakepPHP (in the cake\lib\Cake\Controller\Component\Auth folder)
So I am trying extend the base Application class and add member variables to
I'm Trying to extend a non-moose class, and when I call an accessor defined
I am trying to extend the mysqli class to make a helper class that
I have a thing which I thought should work, but it doesn't. I have
Right now, I'm trying to work around an IE6/7 bug which requires the wrapping
Hi I'm trying to override Mage_Customer_AccountController, so that I can extend the createPostAction method.
I am trying to extend the CodeIgniter controller. I have created MY_Controller.php file, the
I'm trying to extend NSImageView so I can delegate the drag/drop responsibility to the
I am currently trying to replace my own database controller implementation with Hibernate and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.