Welcome Guest, Not a member yet? Register   Sign In
accessing to custom config file
#1

Hi, 
I created config/facebook.php config file and put facebook configs in it. I have an library for facebook api in libraries/facebook.php

My question is how I can access configs from config/facebook.php in libraries/facebook.php. I mean how does CI system libraries do it. 

currently I am doing it in following way:
PHP Code:
   public function __construct()
 
   {
 
       $CI =& get_instance();
 
       $CI->load->config('facebook'TRUE);
 
       $this->appId $CI->config->item('appId''facebook');
 
       $this->secret $CI->config->item('secret''facebook');
 
       $this->cookie $CI->config->item('cookie''facebook');
 
       $this->scope $CI->config->item('scope''facebook');
 
   


when I searched for  'load->config(' in CI system directory it didnot find any result. So is this means CI system libs access to config files in different way?
Reply


Messages In This Thread
accessing to custom config file - by neuron - 01-30-2017, 12:33 AM
RE: accessing to custom config file - by ciadmin - 01-30-2017, 01:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB