From eb6db84333c40ed8d15dec5014564120ee0c60e6 Mon Sep 17 00:00:00 2001
From: admin
Where filename is the name of your config file, without the .php file extension.
+If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if
+you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE
+and each config file will be stored in an array index corresponding to the name of the config file. Example:
+
+
+// Stored in an array with this prototype: $this->config['blog_settings'] = $config
+
+
+$this->config->load('blog_settings', TRUE);
Please see the section entitled Fetching Config Items below to learn how to retrieve config items set this way.
+ +The third parameter allows you to suppress errors in the event that a config file does not exist:
+ +$this->config->load('blog_settings', FALSE, TRUE);
+
+
+
To retrive an item from your config file, use the following function:
+To retrieve an item from your config file, use the following function:
$this->config->item('item name');
@@ -119,6 +135,20 @@ indicated in the file.
The function returns FALSE (boolean) if the item you are trying to fetch does not exist.
+If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index
+you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:
+
+
+// Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
+
+$this->config->load('blog_settings', 'TRUE');
+
+// Retrieve a config item named site_name contained within the blog_settings array
+$site_name = $this->config->item('site_name', 'blog_settings');
+
+// An alternate way to specify the same item:
+$blog_config = $this->config->item('blog_settings');
+$site_name = $blog_config['site_name'];
If you would like to dynamically set a config item or change an existing one, you can so so using:
-- cgit v1.2.3-24-g4f1b