7

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 ?

2 Answers 2

4

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.

4

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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