File Template Variable Problem

I cannot make this work:

private static function loadPropertiesFromGlobalVariables($aVariableNames){
  foreach($aVariableNames as $sVariableName){
   if(array_key_exists($sVariableName, $GLOBALS))
    self::$$sVariableName = $GLOBALS[$sVariableName];
   unset($sVariableName);
  }
}


This is how I have it in the template:

private static function loadPropertiesFromGlobalVariables(\$aVariableNames){
  foreach(\$aVariableNames as \$sVariableName){
   if(array_key_exists(\$sVariableName, \$GLOBALS))
    self::\$\$sVariableName = \$GLOBALS[\$sVariableName];
   unset(\$sVariableName);
  }
}


And this what I get:

private static function loadPropertiesFromGlobalVariables($aVariableNames){
  foreach($aVariableNames as $sVariableName){
   if(array_key_exists($sVariableName, $GLOBALS))
    self::$sVariableName = \$GLOBALS[$sVariableName];
   unset($sVariableName);
  }
}

1 comment
Comment actions Permalink

wow, nothing??

0

Please sign in to leave a comment.