public function replace( $key, $value )
    {
        if($value === "" || is_null($value) || $value === false) {
            $this->url = preg_replace("#/{" . $key . "}.*$#", "", $this->getUrl());
        } else {
            $this->url = str_replace("{" . $key . "}", $value, $this->getUrl());
        }

        return $this;
    }
public function replace( $key, $value )
    {
        if($value === "" || is_null($value) || $value === false) {
            $this->url = preg_replace("#/{" . $key . "}.*$#", "", $this->getUrl());
        } else {
            $this->url = str_replace("{" . $key . "}", $value, $this->getUrl());
        }

        return $this;
    }
public function replace ( $ key , $ value ) { if ( $ value === "" || is_null ( $ value ) || $ value === false ) { $ this -> url = preg_replace ( "#/{" . $ key . "}.*$#" , "" , $ this -> getUrl ( ) ) ; } else { $ this -> url = str_replace ( "{" . $ key . "}" , $ value , $ this -> getUrl ( ) ) ; } return $ this ; }
Replace a substring for making URL templates

@param $key
@param $value

@return Href
Replace a substring for making URL templates