Welcome Guest, Not a member yet? Register   Sign In
Set second level config item
#1

[eluser]regal2157[/eluser]
I'm playing with the config files and such - exploring some possibilities with it, but I ran into a problem the userguide does not clarify, nor can I manage to figure out how to do it.

Let's say I have a basic config file: testconfig.php
Code:
<?php
$config['site_name'] = 'Sample';

And I have a test controller that loads this config file: testconfig.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class TestConfig extends CI_Controller {

public function __construct()
{
  parent::__construct();
}

public function index()
{
  $this->load->config('testconfig', TRUE);  
  echo $this->config->item('site_name','testconfig');
}
}

This part works as expected.

Now, when I try to set a value, I can't. It will just make a new config item, and not modify the array "testconfig"

How would I set a second level config item?

This is not a real world example - but just an example to justify the utilization of my request. Any questions, let me know.




Theme © iAndrew 2016 - Forum software by © MyBB