Welcome Guest, Not a member yet? Register   Sign In
Application settings
#1

[eluser]mreeves[/eluser]
I am currently developing a multi-site CMS tailored to a specific purpose. For site specific application settings, which are stored in teh DB, I have the following in MY_Controller.php

Code:
$this->load->model('site_model');
$site = $this->site_model->get_site($_SERVER['HTTP_HOST']);
$this->config->set_item('site_name', $site['site_name']);
$this->config->set_item('site_id', $site['site_id']);

$this->load->model('settings/settings_model');
$settings = $this->settings_model->get_settings($site['site_id']);
foreach($settings as $setting)
{
    $this->config->set_item($setting['setting_name'], $setting['setting_value']);
}

Is this the best approach to take?




Theme © iAndrew 2016 - Forum software by © MyBB