CodeIgniter Forums
weird problem setting config indexes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: weird problem setting config indexes (/thread-40698.html)



weird problem setting config indexes - El Forum - 04-15-2011

[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.


weird problem setting config indexes - El Forum - 04-15-2011

[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


weird problem setting config indexes - El Forum - 04-16-2011

[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.


weird problem setting config indexes - El Forum - 04-16-2011

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

InsiteFX