How to access $config array |
[eluser]Unknown[/eluser]
Hello, I'm trying to get value which set at config.php from my controller: Code: $config['base_url'] = "http://localhost/ci/"; Now I do it like this: Code: $this->config->config['base_url'] Is there any better way instead specifying 'config' twice? Thanks
[eluser]theprodigy[/eluser]
According to the Config Class Docs: Code: $this->config->item('item name');
[eluser]Atharva[/eluser]
you can use Code: base_url()
[eluser]Aken[/eluser]
Alternatively, config_item('item') is available globally without loading any additional resources. |
Welcome Guest, Not a member yet? Register Sign In |