Welcome Guest, Not a member yet? Register   Sign In
Autoload a config item in an array
#1

[eluser]redwiz[/eluser]
hi all

in my project i have to load in every page a config item as an array in this way:

$this->config->load('MYITEM',TRUE);

I cannot figure out if is possible to load config items in this way via the config/autoload.php file.


can you help me?

thanks
#2

[eluser]umefarooq[/eluser]
yes you can load config in autoload check line# 82 in autoload.php file
#3

[eluser]redwiz[/eluser]
[quote author="umefarooq" date="1288883539"]yes you can load config in autoload check line# 82 in autoload.php file[/quote]


yes but i was asking if is possbile to load the config intem in a separate array , like using the second parameter (to avoid collisions) of the function

$this->config->load('ITEM',TRUE)

maybe is possibile only to load items from the autoload file only in this way?

$this->config->load('ITEM')
#4

[eluser]techgnome[/eluser]
Yes... I've done something similar... I put my custom configs in to a new config file... then when I load it, I pass the true parameter... when I then need the settings, I snag it out of the config array.

Code:
$this->myConfig = $this->config->item['myconfig'];
Now I have my custom config settings in their own array, and I use that to reference the settings I need.

-tg
#5

[eluser]nuwanda[/eluser]
Or you could just create a constant in the config/constants file.




Theme © iAndrew 2016 - Forum software by © MyBB