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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:11:10+00:00 2026-05-25T10:11:10+00:00

I have some global settings variables I need to store for my application, but

  • 0

I have some global settings variables I need to store for my application, but I’m confused as to whether I should use a custom config file or just add new constants to the bottom of the config/constants.php file? These variables won’t be changing once set, so are constants the right choice?

What’s the difference between the two, and how does Codeigniter handle them?

  • 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-05-25T10:11:11+00:00Added an answer on May 25, 2026 at 10:11 am

    Custom config file IMO. That will make your life easier down the line when you decide to upgrade to a new major release of CI, since you’ll be able to overwrite config.php without losing critical application constants.

    The application-wide config.php is always loaded, so anything you put in there will be globally available, whereas custom config files can be loaded on-demand, saving resources and providing better separation of code responsibilities.

    Example: On-demand loading of a config file:

    $this->config->load('filename');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I usually have a config-file with some global variables for database connectivity settings (such
I usually have a config-file with some global variables for database connectivity settings (such
I have some settings in my app.config which I intend to be 'global' -
I have some global settings in my application that is going to be handled
I have set up some custom symfony project-level settings in the file config/project.yml following
I have some global variables in a Python script. Some functions in that script
Hey right now I'm using jQuery and I have some global variables to hold
I have a javascript function (function1) that checks some global variables (can the user
I want to keep some global settings for my project in Django. I need
I'm setting some global configuration variables in the following manner: $yaml = file_exists('config.yml') ?

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.