ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently developing custom config files.

Some of my files are deeply located in my architecture and I want to use some of my variables in the config as specific tag.

Example :


like that :


Is there a way to do it ?

share|improve this question
up vote 4 down vote accepted

I found the solution:

global $assign_to_config;
    if( ! isset($assign_to_config['global_vars']))
        $assign_to_config['global_vars'] = array();

    $main_global = array(
        'global:env'      => ENV,
        'global:env_full' => ENV_FULL
$assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $master_global, $env_global);

Now I can assign custom global in my $main_global.

share|improve this answer

You can still use the Global Variables Array, that formerly existed in the path.php file, but now exists in your primary index.php file for the site.

I've include an example of the formatting:

$assign_to_config['global_vars'] = array(
    'subsite_id' => 'subsite01',
    'subsite_no' => '259',
    'domain' => '',
    'https' => $_SERVER["HTTPS"],
    ); // This array must be associative
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.