• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
accessing to custom config file

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();
       $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?

https://www.codeigniter.com/user_guide/l...er::config and https://www.codeigniter.com/user_guide/l...al-loading

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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