Skip to content

Instantly share code, notes, and snippets.

@og-shawn-crigger
Created October 30, 2011 01:02
Show Gist options
  • Save og-shawn-crigger/1325321 to your computer and use it in GitHub Desktop.
Save og-shawn-crigger/1325321 to your computer and use it in GitHub Desktop.
Start of reading/writing Config Options From Database
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Config extends CI_Config {
public function database()
{
if (function_exists('get_instance'))
{
$CI =& get_instance();
$query = $CI->db->get('config');
foreach ($query->result() as $item)
{
$this->set_item($item->name, $item->value);
}
}
}
}
/* End of file MY_Config.php */
/* Location: ./application/core/MY_Config.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment