protected function parseTemplate($template, array $vars = array())
    {
        if (strpos($template, '{') === false) {
            return $template;
        }

        if (preg_match_all('@\{\$([A-Za-z0-9_]+)\}@i', $template, $matches)) {
            foreach ($matches[1] as $varName) {
                $template = str_replace('{$' . $varName . '}', $vars[$varName], $template);
            }
        }

        return $template;
    }
protected function parseTemplate($template, array $vars = array())
    {
        if (strpos($template, '{') === false) {
            return $template;
        }

        if (preg_match_all('@\{\$([A-Za-z0-9_]+)\}@i', $template, $matches)) {
            foreach ($matches[1] as $varName) {
                $template = str_replace('{$' . $varName . '}', $vars[$varName], $template);
            }
        }

        return $template;
    }
protected function parseTemplate ( $ template , array $ vars = array ( ) ) { if ( strpos ( $ template , '{' ) === false ) { return $ template ; } if ( preg_match_all ( '@\{\$([A-Za-z0-9_]+)\}@i' , $ template , $ matches ) ) { foreach ( $ matches [ 1 ] as $ varName ) { $ template = str_replace ( '{$' . $ varName . '}' , $ vars [ $ varName ] , $ template ) ; } } return $ template ; }
Parses a template string.

@param string $template A template string.
@param mixed[] $vars Template variables.

@return string The parsed template string.

@see https://github.com/composer/installers This code is based on the Composer Installer.
Parses a template string .