Skip to content
This repository has been archived by the owner on Nov 24, 2019. It is now read-only.

v1 Get db configuration

vee w, edited this page Jan 31, 2014 · 1 revision

The db configurations are store in <table_prefix>config table.

To get those configuration from table has 2 ways.

Get single config value

Use this code.

\Model_config::getval($config_name, $return_field = 'config_value');

$config_name is config_name field in database $return_field is what field you want it to return from db.

Example:

\Model_config::getval('site_name');// return "Fuel Start"

Get multiple config values

Use this code.

\Model_config::getvalues($config_name);

$config_name from this method require to be array of config name

Example:

$config_names = array('site_name', 'page_title_separator');
$config = \Model_Config::getvalues($config_names);

// to access value of those config you need to get ['value'] from $config result
// get site name config value
echo $config['site_name']['value'];
echo $config['page_title_separator']['value'];