public function getUrlFromRouteName($locale, $transKey, array $attributes = [], $showHiddenLocale = false)
    {
        $this->isLocaleSupportedOrFail($locale);

        $route = $this->routeTranslator->getUrlFromRouteName(
            $locale,
            $this->getDefaultLocale(),
            $transKey,
            $attributes,
            $this->isDefaultLocaleHiddenInUrl(),
            $showHiddenLocale
        );

        // This locale does not have any key for this route name
        if (empty($route)) return false;

        return rtrim($this->createUrlFromUri($route));
    }
public function getUrlFromRouteName($locale, $transKey, array $attributes = [], $showHiddenLocale = false)
    {
        $this->isLocaleSupportedOrFail($locale);

        $route = $this->routeTranslator->getUrlFromRouteName(
            $locale,
            $this->getDefaultLocale(),
            $transKey,
            $attributes,
            $this->isDefaultLocaleHiddenInUrl(),
            $showHiddenLocale
        );

        // This locale does not have any key for this route name
        if (empty($route)) return false;

        return rtrim($this->createUrlFromUri($route));
    }
public function getUrlFromRouteName ( $ locale , $ transKey , array $ attributes = [ ] , $ showHiddenLocale = false ) { $ this -> isLocaleSupportedOrFail ( $ locale ) ; $ route = $ this -> routeTranslator -> getUrlFromRouteName ( $ locale , $ this -> getDefaultLocale ( ) , $ transKey , $ attributes , $ this -> isDefaultLocaleHiddenInUrl ( ) , $ showHiddenLocale ) ; // This locale does not have any key for this route name if ( empty ( $ route ) ) return false ; return rtrim ( $ this -> createUrlFromUri ( $ route ) ) ; }
Returns an URL adapted to the route name and the locale given.

@param  string|bool  $locale
@param  string       $transKey
@param  array        $attributes
@param  bool|false   $showHiddenLocale

@return string|false
Returns an URL adapted to the route name and the locale given .