PHP Класс PartKeepr\ImageBundle\Controller\ImageController

Наследование: extends PartKeepr\UploadedFileBundle\Controller\FileController
Показать файл Открыть проект

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

Метод Описание
ensureCacheDirExists ( ) Ensures that the image cache directory exists.
fitWithin ( UploadedFile $image, integer $width, integer $height, boolean $padding = false ) : string Scales the image to fit within the given size.
getImageAction ( Request $request, $id ) : ImageResponse | Response
getImageCacheDirectory ( ) : string Returns the path to the image cache directory.
getImageCacheFilename ( UploadedFile $image, integer $width, integer $height, string $mode ) : string Returns the path to an image which has been cached in a particular width, height and mode.

Защищенные методы

Метод Описание
hasCacheFile ( UploadedFile $image, $width, $height, $mode ) : boolean Checks if the database contains the cache file.

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

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

Ensures that the image cache directory exists.

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

Scales the image to fit within the given size.
public fitWithin ( UploadedFile $image, integer $width, integer $height, boolean $padding = false ) : string
$image PartKeepr\UploadedFileBundle\Entity\UploadedFile The image to scale
$width integer The width
$height integer The height
$padding boolean If true, pad the output image to the given size (transparent background).
Результат string The path to the scaled file

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

public getImageAction ( Request $request, $id ) : ImageResponse | Response
$request Symfony\Component\HttpFoundation\Request
$id
Результат PartKeepr\ImageBundle\Response\ImageResponse | Symfony\Component\HttpFoundation\Response

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

Returns the path to the image cache directory.
public getImageCacheDirectory ( ) : string
Результат string

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

Returns the path to an image which has been cached in a particular width, height and mode.
public getImageCacheFilename ( UploadedFile $image, integer $width, integer $height, string $mode ) : string
$image PartKeepr\UploadedFileBundle\Entity\UploadedFile The image
$width integer The width
$height integer The height
$mode string The mode
Результат string

hasCacheFile() защищенный Метод

Checks if the database contains the cache file.
protected hasCacheFile ( UploadedFile $image, $width, $height, $mode ) : boolean
$image PartKeepr\UploadedFileBundle\Entity\UploadedFile
$width
$height
$mode
Результат boolean