engineering student
engineering student

Reputation: 233

Can application/config/email.php be modified with php code in codeigniter?

I have a settings_view in which there is a textField and I would like to give the user the option to modify application/config/email.php and more precisely the $config['smtp_user'] so the latter would receive the string entered by the user. I already know how to get the controller to receive the value by creating a form in the view and then send it to another view or use the value in a db query but I'm wondering whether I can actually make it so the config/email.php can be modified. I would appreciate it if someone could point me in the right direction or tell me to stop searching if this is not doable.

Upvotes: 0

Views: 114

Answers (1)

cssBlaster21895
cssBlaster21895

Reputation: 3710

You can place your settings inside config/email.php, but you can also modify them inside your controller. It overwrites variables that you are only interested and will also use the rest from config file.

$new_config_values = array(
   'new_key' => 'new value'
);

$this->email->initialize($new_config_values);

Upvotes: 2

Related Questions