public static function replace($string, array $vars)
    {
        if (preg_match_all('/:([a-z_]+)/', $string, $matches)) {
            list($original, $variables) = $matches;

            foreach ($variables as $key => $var) {
                if (isset($vars[$var])) {
                    $string = str_replace($original[$key], $vars[$var], $string);
                }
            }
        }

        return $string;
    }