PHP Class Bkwld\Croppa\Helpers

Afficher le fichier Open project: bkwld/croppa Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

delete() public méthode

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
Résultat void

render() public méthode

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

reset() public méthode

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
Résultat void

tag() public méthode

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')
Résultat string An HTML img tag for the new image

url() public méthode

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')
Résultat string The new path to your thumbnail