PHP Класс Bkwld\Croppa\Helpers

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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().

Описание методов

__construct() публичный Метод

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

delete() публичный Метод

Delete source image and all of it's crops
См. также: Bkwld\Croppa\Storage::deleteSrc()
См. также: Bkwld\Croppa\Storage::deleteCrops()
public delete ( string $url ) : void
$url string URL of src image
Результат void

render() публичный Метод

Render image
См. также: Bkwld\Croppa\URL::generate()
public render ( string $url ) : string
$url string URL of an image that should be rendered
Результат string The new path to your thumbnail

reset() публичный Метод

Delete just the crops, leave the source image
См. также: Bkwld\Croppa\Storage::deleteCrops()
public reset ( string $url ) : void
$url string URL of src image
Результат void

tag() публичный Метод

Create an image tag rather than just the URL. Accepts the same params as url()
См. также: 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')
Результат string An HTML img tag for the new image

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