public static function parseTemplate($tag, $replacements)
        {
//          get template
            $template = self::getTemplate($tag);
            $search = $replace = array();
//          compile search and replace values for replacement
            foreach ($replacements as $varname => $varvalue)
            {
                array_push($search, '%'.strtolower($varname).'%');
                array_push($replace, $varvalue);
            }
            return str_replace($search, $replace, $template);
        }