Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

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 :

{site_url}assets/css/style.css

like that :

{css_url}style.css

Is there a way to do it ?

share|improve this question
add comment

2 Answers 2

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
add comment

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' => 'http://mydomain.org',
    'https' => $_SERVER["HTTPS"],
    ); // This array must be associative
share|improve this answer
add comment

Your Answer

 
discard

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.