Loading Config Item in Helper - Pls Help

#1
[eluser]Deep Arora[/eluser]
I am trying to load a config item in helper function I am writing as:

Code:
$S3AWSID = $this->config->item('S3_ACCESS_KEY_ID');

But it throws a message as:

Code:
Fatal error: Using $this when not in object context in customer_helper.php on line 28


How can I call and use config params in helper?

#2
[eluser]Colin Williams[/eluser]
Either

Code:
$ci =& get_instance();
$var = $ci->config->item('setting');

or, more simply

Code:
$var = config_item('setting');

#3
[eluser]Deep Arora[/eluser]
Worked like a charm...CI folks are always awesome Smile

Thanks!!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.