PHP Класс Bolt\Twig\Handler\ImageHandler

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

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

Метод Описание
__construct ( Silex\Application $app )
image ( string $fileName = null, string | integer $width = null, string | integer $height = null, string $crop = null ) : string Helper function to make a path to an image.
imageInfo ( string $fileName, string $safe ) : Bolt\Filesystem\Handler\ImageInterface Get an image.
popup ( string | array $fileName = null, integer $width = null, integer $height = null, string $crop = null, string $title = null ) : string Helper function to wrap an image in a Magnific popup HTML tag, with thumbnail.
showImage ( string $fileName = null, integer $width = null, integer $height = null, string $crop = null ) : string Helper function to show an image on a rendered page.
thumbnail ( string $fileName = null, string | integer $width = null, string | integer $height = null, string $crop = null ) : string Helper function to make a path to an image thumbnail.

Приватные методы

Метод Описание
getAliasedUri ( mixed $filename, string $alias ) : mixed Get the thumbnail relative URI, using an alias.
getThumbnail ( string | array $fileName = null, integer $width = null, integer $height = null, string $scale = null ) : Bolt\Helpers\Image\Thumbnail Get a thumbnail object.
getThumbnailUri ( Bolt\Helpers\Image\Thumbnail $thumb ) : mixed Get the thumbnail relative URI, using width, height and action.
isAlias ( $alias )

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

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

public __construct ( Silex\Application $app )
$app Silex\Application

image() публичный метод

Helper function to make a path to an image.
public image ( string $fileName = null, string | integer $width = null, string | integer $height = null, string $crop = null ) : string
$fileName string Target filename
$width string | integer Target width
$height string | integer Target height
$crop string String identifier for cropped images
Результат string Image path

imageInfo() публичный метод

Get an image.
public imageInfo ( string $fileName, string $safe ) : Bolt\Filesystem\Handler\ImageInterface
$fileName string
$safe string
Результат Bolt\Filesystem\Handler\ImageInterface

popup() публичный метод

example: {{ content.image|popup(320, 240) }} example: {{ popup(content.image, 320, 240) }} example: {{ content.image|popup(width=320, height=240, title="My Image") }}
public popup ( string | array $fileName = null, integer $width = null, integer $height = null, string $crop = null, string $title = null ) : string
$fileName string | array Image file name
$width integer Image width
$height integer Image height
$crop string Crop image string identifier
$title string Display title for image
Результат string HTML output

showImage() публичный метод

Set width or height parameter to '0' for proportional scaling. Set them both to null (or not at all) to get the default size from config.yml. Example: {{ content.image|showimage(320, 240) }} Example: {{ showimage(content.image, 320, 240) }}
public showImage ( string $fileName = null, integer $width = null, integer $height = null, string $crop = null ) : string
$fileName string Image filename
$width integer Image width
$height integer Image height
$crop string Crop image string identifier
Результат string HTML output

thumbnail() публичный метод

Helper function to make a path to an image thumbnail.
public thumbnail ( string $fileName = null, string | integer $width = null, string | integer $height = null, string $crop = null ) : string
$fileName string Target filename
$width string | integer Target width
$height string | integer Target height
$crop string Zooming and cropping: Set to 'f(it)', 'b(orders)', 'r(esize)' or 'c(rop)' Set width or height parameter to '0' for proportional scaling Setting them to '' uses default values.
Результат string Relative URL of the thumbnail