url() 공개 메소드

Pass through URL requests to URL->generate().
또한 보기: Bkwld\Croppa\URL::generate()
public url ( string $url, integer $width = null, integer $height = null, array $options = null ) : string
$url string URL of an image that should be cropped
$width integer Target width
$height integer Target height
$options array Additional Croppa options, passed as key/value pairs. Like array('resize')
리턴 string The new path to your thumbnail
예제 #1
0
 public function url($url, $width = null, $height = null, $options = null)
 {
     if (strpos($url, URL::to('/')) === 0) {
         $url = substr_replace($url, '', 0, strlen(URL::to('/')));
     }
     if (preg_match('#^/(' . config('coaster::frontend.croppa_handle') . ')$#', $url)) {
         $url = '/cache' . $url;
     }
     return parent::url($url, $width, $height, $options);
 }
예제 #2
0
 /**
  * Pass through URL requrests to URL->generate().
  *
  * @param string $url URL of an image that should be cropped
  * @param integer $width Target width
  * @param integer $height Target height
  * @param array $options Addtional Croppa options, passed as key/value pairs.  Like array('resize')
  * @return string The new path to your thumbnail
  * @see Bkwld\Croppa\URL::generate()
  */
 public function url($url, $width = null, $height = null, $options = null)
 {
     $config_ignore = Config::get('croppa.ignore');
     return $width == null && $height == null || preg_match('#' . $config_ignore . '#', $url) ? $this->rawUrl($url) : parent::url($url, $width, $height, $options);
 }