isValidUrl() public method

Determine if the given path is a valid URL.
public isValidUrl ( string $path ) : boolean
$path string
return boolean
Example #1
0
 /**
  * Do a few checks to get the theme path for a given asset url.
  *
  * @param string $url
  * @return string
  */
 protected function assetUrl($url)
 {
     if ($this->url->isValidUrl($url)) {
         return $url;
     }
     $theme = StylistFacade::current();
     if ($theme) {
         $themePath = $theme->getAssetPath();
         $url = "themes/{$themePath}/{$url}";
     }
     return $url;
 }
Example #2
0
 /**
  * Determine if the given path is a valid URL.
  *
  * @param string $path
  * @return bool 
  * @static 
  */
 public static function isValidUrl($path)
 {
     return \Illuminate\Routing\UrlGenerator::isValidUrl($path);
 }