getUrl() публичный Метод

Get full URL to image (if not CLI mode)
public getUrl ( ) : string
Результат string
Пример #1
0
 /**
  * @param $file
  * @return array
  */
 public function uploadScreenShot3($file)
 {
     $name = Str::random() . '.' . strtolower($file->ext);
     $image = new Image($file->image);
     $image->saveAs(PATH_PUBLIC . '/images/' . $name, 100);
     return array('UploadScreenShot3Result' => $image->getUrl());
 }
Пример #2
0
 /**
  * @expectedException \JBZoo\Image\Exception
  */
 public function testGetPathUndefined()
 {
     $_SERVER['DOCUMENT_ROOT'] = __DIR__;
     $_SERVER['HTTP_HOST'] = 'test.dev';
     $_SERVER['SERVER_PORT'] = 80;
     $_SERVER['REQUEST_URI'] = '/test.php?foo=bar';
     $_SERVER['QUERY_STRING'] = 'foo=bar';
     $_SERVER['PHP_SELF'] = '/test.php';
     $img = new Image();
     isSame('', $img->getUrl());
 }