CodeIgniter Forums

Full Version: Site global setting variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


I want some general global settings variables that can be accessed from anywhere like model,view,controller etc...

I found this code..

Can it be used in model without using of CI=& etc....

What can be the best approach.

// 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');