Using EE2.0, I’m trying to figure out what the best approach is to including/embeding a config file at the beginning of a template. For example, in my index file I might have:
{embed="shell/config"}
{embed="shell/header"}
some content
<?php echo $var_from_config_file; ?>
more content
{embed="shell/footer"}Within shell/config I have a bunch of variables, constants, functions, whatever defined to be used in other files.
Will this work at all? I can’t seem to access vars defined in config from index, even if I global them. If I define it in index before the shell/config embed, and then try to access the var in config, it works fine, but not as I have it above.
Is there a better solution for this? I absolutely need to be able to embed/include a config file at the top of each page. Ideally I’d even just put it in the header file but I’m trying to keep it simple for the sake of the example.