Created
August 15, 2012 13:57
-
-
Save litzinger/3360372 to your computer and use it in GitHub Desktop.
server name as global variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Add this to your config.php file | |
*/ | |
$default_global_vars = array( | |
'global:domain_name' => $_SERVER['SERVER_NAME'] | |
); | |
// Make this global, then add our default_global_vars to the config variables here | |
global $assign_to_config; | |
if(!isset($assign_to_config['global_vars'])) $assign_to_config['global_vars'] = array(); | |
$assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars); | |
/* | |
Use in your template as {global:domain_name} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment