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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:51:00+00:00 2026-06-04T10:51:00+00:00

As you might know, when you create a new project with CI you’ll have

  • 0

As you might know, when you create a new project with CI you’ll have to manually enter base url, encryption key in config/config.php. I’m trying to overcome this and is hence looking for a way to read those values from a database instead – making the installation for a customer and the set up time as a whole decrease a lot.

A customer isn’t able to edit a PHP file’s variables, but is most likely able to, with some guidance, enter base url and have a encryption key automatically filled in by the system.

Is there any way to accomplish 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-04T10:51:02+00:00Added an answer on June 4, 2026 at 10:51 am

    Of course! Add a hook – post_controller and set these config values through that file.

    config/hooks.php

    $hook['pre_controller'][] = array(  'class'    => 'MyOtherClass',
                                        'function' => 'MyOtherfunction',
                                        'filename' => 'Myotherclass.php',
                                        'filepath' => 'hooks');
    

    hooks/myotherclass.php

    <?
    
    class MyOtherClass {
    
        function MyOtherfunction() {
    
            $CI =& get_instance();
    
            $row = $CI->db->get_where('configs', array('site_id' => 1))->row();
    
            $CI->config->set_item('base_url', $row->base_url);
    
        }
    
    }
    

    Basicly you set these values before they’re used in any controller or similiar.

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

Sidebar

Related Questions

im planning to create a movie file that might have over 16,000 frames?i know
I have created a plugin project in eclipse to create a new category and
I know this might be a long shot, but here it goes. I have
I know this might be very easy to some,, I have a simple string
I have created a new VS2008 ASP.Net Web service project, with the default name
I'm brand new to Rails. I have one Rails project on my machine, but
NOTE: To understand my question, you might need to know about my project and
I need to create a new website, I have the database modeling done and
I know that you can create new classes in R, but why would you
In X code, If I create a new project with automatic reference counting (ARC),

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.