public function getUrlByRouteName($name, array $params = null, $baseUrl = null, $addExt = true, Site $site = null, $buildQuery = false)
    {
        $paramsToAdd = [];
        $uri = $this->applyRouteParameters(
                $this->getRoutePath($name),
                (array) $params,
                $paramsToAdd
        );

        $path = $this->getUri($baseUrl.$uri, null, $site);
        if (true !== $addExt) {
            $path = File::removeExtension($path);
        }

        if (!empty($paramsToAdd) && true === $buildQuery) {
            $path = $path.'?'.http_build_query($paramsToAdd);
        }

        return $path;
    }
public function getUrlByRouteName($name, array $params = null, $baseUrl = null, $addExt = true, Site $site = null, $buildQuery = false)
    {
        $paramsToAdd = [];
        $uri = $this->applyRouteParameters(
                $this->getRoutePath($name),
                (array) $params,
                $paramsToAdd
        );

        $path = $this->getUri($baseUrl.$uri, null, $site);
        if (true !== $addExt) {
            $path = File::removeExtension($path);
        }

        if (!empty($paramsToAdd) && true === $buildQuery) {
            $path = $path.'?'.http_build_query($paramsToAdd);
        }

        return $path;
    }
public function getUrlByRouteName ( $ name , array $ params = null , $ baseUrl = null , $ addExt = true , Site $ site = null , $ buildQuery = false ) { $ paramsToAdd = [ ] ; $ uri = $ this -> applyRouteParameters ( $ this -> getRoutePath ( $ name ) , ( array ) $ params , $ paramsToAdd ) ; $ path = $ this -> getUri ( $ baseUrl . $ uri , null , $ site ) ; if ( true !== $ addExt ) { $ path = File :: removeExtension ( $ path ) ; } if ( ! empty ( $ paramsToAdd ) && true === $ buildQuery ) { $ path = $ path . '?' . http_build_query ( $ paramsToAdd ) ; } return $ path ; }
Returns complete url which match with routeName and routeParams; you can also customize
the base url; by default it use current site base url.

@param  string      $name       The name of the route to look for.
@param  array|null  $params     Optional, parameters to apply to the route.
@param  string|null $baseUrl    Optional, base URL to use rather than the computed one.
@param  boolean     $addExt     If true adds the default extension to result.
@param  Site|null   $site       Optional, the site for which the uri will be built.
@param  boolean     $buildQuery If true, adds unused parameters in querystring

@return string                  The computed URL.
Returns complete url which match with routeName and routeParams ; you can also customize the base url ; by default it use current site base url .