Welcome Guest, Not a member yet? Register   Sign In
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');




Theme © iAndrew 2016 - Forum software by © MyBB