Welcome Guest, Not a member yet? Register   Sign In
Where does $config refers to
#1

Where does $config refers to?

I wonder if I write this code:

$config['image_library'] = 'gd2';
$config['source_image'] = '/path/to/image/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width']         = 75;
$config['height']       = 50;


Where does the code refers to?

Is it this file?  application/config/config.php ?
" If I looks more intelligence please increase my reputation."
Reply
#2

You application can retrieve the values you set inside a file in the config dir. For example if you create some library wich uses an external API and you need to store the API key for it. You can create a config file called my_api_labrary.php and add
PHP Code:
$config['api_key'] = 'e8ce634e281c2f50866ca941ecd8ac7f'

Then in your library you can use:
PHP Code:
// Now you can easily access your API key which is stored in the config file
$this->config->load('my_api_labrary');
$api_key $this->config->item('api_key'); // holds: e8ce634e281c2f50866ca941ecd8ac7f 


Reference: http://www.codeigniter.com/user_guide/li...onfig.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB