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);
 }