Welcome Guest, Not a member yet? Register   Sign In
Image Lib Config File
#1

[eluser]megabyte[/eluser]
The user guide states the following:

If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called image_lib.php, add the $config array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.


Which is great because you can seprate all your config values. Problem is what do you do if you want to store the config values for more than one image manipulation script?

Can you use a multi dimensional array for the $config

I tried to use my own config file and it didnt work, I had a controller called image_gallery.php and created a cofig file under the config folder called image_gallery.php I then loaded it, and the values were available using $this->config->item() but they were not automatically available like they are when you set them in a config file called image_lib.php.

Am I correct? has anyone else noticed this? Or did I make a mistake somewhere?
#2

[eluser]Colin Williams[/eluser]
User guide says:

Quote:If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called image_lib.php, add the $config array in that file.

You did:

Quote:and created a cofig file under the config folder called image_gallery.php

I can only imagine why it's not working! ;-P

Quote:Which is great because you can seprate all your config values. Problem is what do you do if you want to store the config values for more than one image manipulation script?

Save each one to a custom config item (not config/image_lib.php) and pass them into the image_lib inititialize() method

Code:
$this->image_lib->initialize($this->config->item('img_processes', 'thumbnail'))




Theme © iAndrew 2016 - Forum software by © MyBB