public function uriReplace($key, $params)
    {
        $string = $this->uris[$key];

        $matches = null;
        $matcher = preg_match_all($this->regex, $string, $matches);

        $original = $matches[0];
        $vars     = $matches[1];

        foreach ($vars as $key => $variable) {
            if ($attribute = $params[$variable]) {
                $string = str_replace($original[$key], $attribute, $string);
            }
        }

        return $string;
    }
public function uriReplace($key, $params)
    {
        $string = $this->uris[$key];

        $matches = null;
        $matcher = preg_match_all($this->regex, $string, $matches);

        $original = $matches[0];
        $vars     = $matches[1];

        foreach ($vars as $key => $variable) {
            if ($attribute = $params[$variable]) {
                $string = str_replace($original[$key], $attribute, $string);
            }
        }

        return $string;
    }
public function uriReplace ( $ key , $ params ) { $ string = $ this -> uris [ $ key ] ; $ matches = null ; $ matcher = preg_match_all ( $ this -> regex , $ string , $ matches ) ; $ original = $ matches [ 0 ] ; $ vars = $ matches [ 1 ] ; foreach ( $ vars as $ key => $ variable ) { if ( $ attribute = $ params [ $ variable ] ) { $ string = str_replace ( $ original [ $ key ] , $ attribute , $ string ) ; } } return $ string ; }
Replaces variables in one of the URIs.

@param string $key    A key from URIs.
@param array  $params Parameters to replace placeholders with.

@return string A string with placeholders replaced.

@see self::$uris The URIs that can be replaced.
Replaces variables in one of the URIs .