PHP 클래스 Bolt\Twig\Handler\ImageHandler

파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

공개 메소드들

메소드 설명
__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