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

  • Home
  • SEARCH
  • 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 6351117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:56:24+00:00 2026-05-24T21:56:24+00:00

I use Codeigniter framework , and you know when I try to load a

  • 0

I use Codeigniter framework , and you know when I try to load a config file then use it

I do something like that :

$this->load->config('myconfig', TRUE); 

myconfig.php file is located inside application folder ( application/config/myconfig.php)

and use it like this :

 $this->config->item('get_item', 'myconfig')

My question is : how can I change the location of myconfig file and use it properly ?

I want to put the config file(s) in out folder like this :

  • mysite -> system(folder)
  • mysite -> user_guide(folder)
  • mysite -> myConfigFiles(folder)
  • mysite -> myConfigFiles(folder) / myconfig.php

I need to do something like this :

$this->load->config(base_url.'myConfigFiles/myconfig', TRUE); 

any help ?

  • 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-24T21:56:25+00:00Added an answer on May 24, 2026 at 9:56 pm

    Yes – it is possible to do this. The loader will accept ../../relative/paths. You can use a path relative from the default config directory (an absolute path will not work).

    So let’s say you have this structure (had a hard time following your description):

    • mysite
      • application
        • config <– default directory
      • system
      • myConfigFiles
        • myconfig.php

    You can just do this:

    $this->load->config('../../myConfigFiles/myconfig', TRUE);
    

    This works for pretty much everything – views, libraries, models, etc.


    Note that with the introduction of the ENVIRONMENT constant in version 2.0.1, you can automatically check for config files within the config directory in another directory that matches the name of the current environment. This is really intended to be a convenience method for loading different files depending on if you are in production or development. I’m not 100% sure what your goals are, but this additional knowledge may also help you achieve them, or it may be totally irrelevant.

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

Sidebar

Related Questions

I use CodeIgniter as my web application framework. I used a simple Try/Catch and
Fairly straightforward question: I know that Codeigniter is a MVC framework - however what
i use a simple PHP framework (like Codeigniter) without ORM. I have a database
Discussed this with a developer as I suggested to use CodeIgniter framework over standard
Is there a way to integrate CodeIgniter with phpBB3? I would like to use
I am newbie. I have Windows XP and use the CodeIgniter framework. I wanted
Please how can I use spl_autoload_register() with Codeigniter? I need to do this because
If you have worked with some of the frameworks like CodeIgniter or KohanaPHP, then
I currently use CodeIgniter as my framework of choice when using PHP. One of
First off I am using the Codeigniter Framework so this issue is a workaround

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.