LaravelLocalization::getLocalizedURL PHP Method

getLocalizedURL() public static method

Returns an URL adapted to $locale
public static getLocalizedURL ( string | boolean $locale = null, string | false $url = null, array $attributes = [] ) : string | false
$locale string | boolean Locale to adapt, false to remove locale
$url string | false URL to adapt in the current language. If not passed, the current url would be taken.
$attributes array Attributes to add to the route, if empty, the system would try to extract them from the url.
return string | false URL translated, False if url does not exist
        public static function getLocalizedURL($locale = null, $url = null, $attributes = array())
        {
            return \Mcamara\LaravelLocalization\LaravelLocalization::getLocalizedURL($locale, $url, $attributes);
        }

Usage Example

Esempio n. 1
0
 function geturl($url, $attributes = array())
 {
     if (!$url) {
         $url = '/';
     }
     return LaravelLocalization::getLocalizedURL(App::getLocale(), $url, $attributes);
 }
All Usage Examples Of LaravelLocalization::getLocalizedURL