PHP Class Bkwld\Croppa\Helpers

Mostrar archivo Open project: bkwld/croppa Class Usage Examples

Public Methods

Method Description
__construct ( URL $url, Bkwld\Croppa\Storage $storage, Handler $handler ) Dependency injection
delete ( string $url ) : void Delete source image and all of it's crops
render ( string $url ) : string Render image
reset ( string $url ) : void Delete just the crops, leave the source image
tag ( string $url, integer $width = null, integer $height = null, array $options = null ) : string Create an image tag rather than just the URL. Accepts the same params as url()
url ( string $url, integer $width = null, integer $height = null, array $options = null ) : string Pass through URL requests to URL->generate().

Method Details

__construct() public method

Dependency injection
public __construct ( URL $url, Bkwld\Croppa\Storage $storage, Handler $handler )
$url URL
$storage Bkwld\Croppa\Storage
$handler Handler

delete() public method

Delete source image and all of it's crops
See also: Bkwld\Croppa\Storage::deleteSrc()
See also: Bkwld\Croppa\Storage::deleteCrops()
public delete ( string $url ) : void
$url string URL of src image
return void

render() public method

Render image
See also: Bkwld\Croppa\URL::generate()
public render ( string $url ) : string
$url string URL of an image that should be rendered
return string The new path to your thumbnail

reset() public method

Delete just the crops, leave the source image
See also: Bkwld\Croppa\Storage::deleteCrops()
public reset ( string $url ) : void
$url string URL of src image
return void

tag() public method

Create an image tag rather than just the URL. Accepts the same params as url()
See also: Bkwld\Croppa\URL::generate()
public tag ( 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')
return string An HTML img tag for the new image

url() public method

Pass through URL requests to URL->generate().
See also: 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')
return string The new path to your thumbnail