CodeIgniter Forums

Full Version: weird problem setting config indexes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]stormbytes[/eluser]
I'm autoloading a custom config file (app/config/arrow.php) with the following index:
Code:
$config['login_validation_url'] = site_url().'login/authorize';

For some reason I get an error when loading the application:
Code:
Fatal error: Call to undefined function site_url()

I'm autoloading the url helper as well.

El Forum

[eluser]InsiteFX[/eluser]
Did you autoload the url_helper ?

It could be that your config is being loaded before the url_helper. Which would mean that you would have to manually load it in a controller or some where else.

InsiteFX

El Forum

[eluser]stormbytes[/eluser]
Yes I autoloaded the Url Helper. You are correct about the helper being loaded after the config file. This is weird since the helper array is located above the config array (and in theory should be loaded before hand).

Bah! I'm going back to KISS.

El Forum

[eluser]InsiteFX[/eluser]
You could try this and see if it works!
Code:
$config['login_validation_url'] = $this->config->site_url('login/authorize');

InsiteFX