• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access config.php settings in email.php?

#1
[eluser]hailwood[/eluser]
Hi there,

I have two config files.

config.php (code igniters core config)

and email.php (autoloaded by the email class when it is used)

What i am wanting to do is.

In config.php have
Code:
$config['env'] = 'hailwood_dev';

then in email.php have
Code:
if($config['env'] == 'hailwood_dev'){
    //email variables like smtp server to do with localhost
    } elseif($config['env'] == 'production'){
    //email variables like smtp server to do with production
    }
But this is not having any effect (im guessing as $config['env'] does not have those values).

How can I access this value?

#2
[eluser]pickupman[/eluser]
PHP commands still work, so you could try at the top of your email.php
Code:
include_once('config.php');


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.