private function createVariadicUrl($haystack, array $args)
    {
        $varCount = substr_count($haystack, self::ROUTE_PARAM_VAR);
        $argCount = count($args);

        // In case, the length is different
        if ($varCount != $argCount) {
            $difference = abs($argCount - $varCount);

            for ($i = 0; $i < $difference; $i++) {
                array_push($args, self::ROUTE_PARAM_VAR);
            }
        }

        $haystack = str_replace(self::ROUTE_PARAM_VAR, '%s', $haystack);
        return vsprintf($haystack, $args);
    }
private function createVariadicUrl($haystack, array $args)
    {
        $varCount = substr_count($haystack, self::ROUTE_PARAM_VAR);
        $argCount = count($args);

        // In case, the length is different
        if ($varCount != $argCount) {
            $difference = abs($argCount - $varCount);

            for ($i = 0; $i < $difference; $i++) {
                array_push($args, self::ROUTE_PARAM_VAR);
            }
        }

        $haystack = str_replace(self::ROUTE_PARAM_VAR, '%s', $haystack);
        return vsprintf($haystack, $args);
    }
private function createVariadicUrl ( $ haystack , array $ args ) { $ varCount = substr_count ( $ haystack , self :: ROUTE_PARAM_VAR ) ; $ argCount = count ( $ args ) ; // In case, the length is different if ( $ varCount != $ argCount ) { $ difference = abs ( $ argCount - $ varCount ) ; for ( $ i = 0 ; $ i < $ difference ; $ i ++ ) { array_push ( $ args , self :: ROUTE_PARAM_VAR ) ; } } $ haystack = str_replace ( self :: ROUTE_PARAM_VAR , '%s' , $ haystack ) ; return vsprintf ( $ haystack , $ args ) ; }
Creates variadic URL

@param string $haystack URI template
@param array $args Arguments to be substituted
@return string
Creates variadic URL