Welcome Guest, Not a member yet? Register   Sign In
Can I 'hack' config like this, without problems?
#1

[eluser]trope[/eluser]
...or is there a better way to do this?

Thank you.

Code:
$env = "localhost";

$config['environment'] = array(

                        "localhost" => array("base_url" => "http://localhost/ci/",
                                             "index_page" => "index.php"
                                            
                                        ),
                                        
                        "production" => array("base_url" => "http://mysite.com",
                                             "index_page" => "index.php"
                                            
                                        )

                         );


/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://example.com/
|
*/
//$config['base_url']    = "http://localhost/ci/";

$config['base_url'] = $config['environment'][$env]['base_url'];
#2

[eluser]WanWizard[/eluser]
I don't like hardcoding anything, so I did this:
- for the base_url: http://ellislab.com/forums/viewthread/160139/#770484
- for the index file: http://ellislab.com/forums/viewthread/160905/#773649




Theme © iAndrew 2016 - Forum software by © MyBB