public function printUrl($route)
    {
        if (empty($route)) {
            return '';
        }

        try {
            $url = $this
                ->urlGenerator
                ->generate($route);
        } catch (ExceptionInterface $e) {
            $url = (string) $route;
        }

        return $url;
    }
public function printUrl($route)
    {
        if (empty($route)) {
            return '';
        }

        try {
            $url = $this
                ->urlGenerator
                ->generate($route);
        } catch (ExceptionInterface $e) {
            $url = (string) $route;
        }

        return $url;
    }
public function printUrl ( $ route ) { if ( empty ( $ route ) ) { return '' ; } try { $ url = $ this -> urlGenerator -> generate ( $ route ) ; } catch ( ExceptionInterface $ e ) { $ url = ( string ) $ route ; } return $ url ; }
Returns an URL given a string representing a route.

@param string $route route name to be converted to an URL

@return string
Returns an URL given a string representing a route .