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 8696667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:19:41+00:00 2026-06-13T01:19:41+00:00

This might sound slightly out there at first. Basically I’m building a small back-end

  • 0

This might sound slightly “out there” at first. Basically I’m building a small back-end in CodeIgniter that I would like to easily be able to roll out to multiple projects in the future. At the moment it’s a collection of controllers, helpers, extended core classes, views and an assets folder. If I want to keep this easy for me to redistribute then I’d like to try and keep the number of individual files down.

Views, controllers and models are obviously best to retain as separate files.
But I’m also extending quite a few of CI’s core classes with my own: CI_Controller, CI_Form_validation and CI_Input. With possibly more to follow.

Is there a way I can combine these 3 into a single file?
Obviously not having them in the application/core directory will break the MY_ prefix autoloading. It would also be brilliant if I could store my custom helper functions in the same file as well. This allows me to preserve any application-specific core classes in application/core in the traditional MY_ prefix format, whilst being able to rollout updates to my core classes easily.

I’m currently using Phil’s Improved Native Autoloader in config.php (see here… http://ellislab.com/codeigniter/forums/viewthread/218099/#1006583) to load my extended core classes without using the MY_ prefix so I can give them more recogniseable and logical names for easier redistribution.
This suggests to me that config.php is processed early enough in initiation that I might be able to just do a cheeky require('AdminCoreClasses.php').
As that’s basically what the native autoloader does but looks at the current class name to specify which file to load. I would just be hard-coding a single file, which contains all my extended core classes in one.

Is there a better way to do this?

  • 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-13T01:19:43+00:00Added an answer on June 13, 2026 at 1:19 am

    At the moment I already just zip my “module” up once I’ve finished making any changes. I do not include the CI system.
    So extracting from the zip does dump everything into the right sub directories.
    I would like to leave the core files untouched as well, for easy upgrading. I actually have different names for my modified classes so I don’t use the MY_ prefix. This allows me to use the MY_ prefix for other modified classes that are nothing to do with my back-end module and on an application-specific basis.

    I am now thinking that I’ll just forget this and carry on the way I’m currently doing it. I don’t want to mess around with the way CI is structured as my primary aim is to keep it easy to upgrade the framework.

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

Sidebar

Related Questions

I know this might sound easy. I thought about using the first dot(.) which
This might sound a bit dumb. I always had this impression that web.config should
This might sound odd, but is there a 'Rails way' to have a model
This might sound like a noob question but this is the first time I'm
Okay this might sound simple but there's a catch. I'll try and explain the
OK so this might sound a bit weird! The thing is that in a
This might sound weird, but when I open a solution that I dont know,
This might sound like a noob question but here goes; Basically, I'm passing a
This might sound odd, but my issue is that I have a text string
This might sound like a stupid question, but google didn't help me. Is there

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.