How to set or get config variables in Codeigniter?

by cristobal , in category: Technology , 4 years ago

How to set or get config variables in Codeigniter?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by bailey_conroy , 4 years ago

In Codeigniter by default all config variables are located at “application/config/config.php” file.

Below is the way to set or get a config variable in Codeigniter

1
2
3
4
// Setting a config variable dynamically
$this->config->set_item('variable_name', value);
// Getting value of config variable in Codeigniter.
$this->config->item('variable_name');


Related Threads:

How to set csrf token in codeIgniter?
How to get last inserted id in CodeIgniter?
How to get random records in MySQL using CodeIgniter?
How to set and get Session in Symfony2?
What Are the Key Features That Make Codeigniter Ideal for Rapid Php Application Development?
What Are the Best Practices for Writing Secure Oracle Sql Queries?