protected function runUrlMethod($name, $path, array $params = [], array $options = [])
    {
        $name = $this->isUrlMethod($name) ? substr($name, 0, -3) : $name;

        //Sets default parameters and options
        $params += ['format' => 'jpg', 'height' => null, 'width' => null];
        $options += ['fullBase' => true];

        $thumber = new ThumbCreator($path);
        is_true_or_fail(method_exists($thumber, $name), __d('thumber', 'Method `{0}::{1}()` does not exist', get_class($this), $name), RuntimeException::class);

        $thumber->$name($params['width'], $params['height'])->save($params);

        return $thumber->getUrl($options['fullBase']);
    }
protected function runUrlMethod($name, $path, array $params = [], array $options = [])
    {
        $name = $this->isUrlMethod($name) ? substr($name, 0, -3) : $name;

        //Sets default parameters and options
        $params += ['format' => 'jpg', 'height' => null, 'width' => null];
        $options += ['fullBase' => true];

        $thumber = new ThumbCreator($path);
        is_true_or_fail(method_exists($thumber, $name), __d('thumber', 'Method `{0}::{1}()` does not exist', get_class($this), $name), RuntimeException::class);

        $thumber->$name($params['width'], $params['height'])->save($params);

        return $thumber->getUrl($options['fullBase']);
    }
protected function runUrlMethod ( $ name , $ path , array $ params = [ ] , array $ options = [ ] ) { $ name = $ this -> isUrlMethod ( $ name ) ? substr ( $ name , 0 , - 3 ) : $ name ; //Sets default parameters and options $ params += [ 'format' => 'jpg' , 'height' => null , 'width' => null ] ; $ options += [ 'fullBase' => true ] ; $ thumber = new ThumbCreator ( $ path ) ; is_true_or_fail ( method_exists ( $ thumber , $ name ) , __d ( 'thumber' , 'Method `{0}::{1}()` does not exist' , get_class ( $ this ) , $ name ) , RuntimeException :: class ) ; $ thumber -> $ name ( $ params [ 'width' ] , $ params [ 'height' ] ) -> save ( $ params ) ; return $ thumber -> getUrl ( $ options [ 'fullBase' ] ) ; }
Runs an "Url" method and returns the url generated by the method
@param string $name Method name
@param string $path Path of the image from which to create the thumbnail.
It can be a relative path (to APP/webroot/img), a full path or a remote
url
@param array $params Parameters for creating the thumbnail
@param array $options Array of HTML attributes for the `img` element
@return string Thumbnail url
@since 1.4.0
@throws RuntimeException
@uses isUrlMethod()
Runs an Url method and returns the url generated by the method