public static function transformUrl($url, $id, $key = '')
    {
        return str_replace(!empty($key) ? $key : ':id', $id, $url);
    }
public static function transformUrl($url, $id, $key = '')
    {
        return str_replace(!empty($key) ? $key : ':id', $id, $url);
    }
public static function transformUrl ( $ url , $ id , $ key = '' ) { return str_replace ( ! empty ( $ key ) ? $ key : ':id' , $ id , $ url ) ; }
Transform url by replacing dummy data.

@param $url
@param $id
@param string $key

@return mixed
Transform url by replacing dummy data .