class Image

Methods

__construct( UrlGenerator $url, HtmlBuilder $html, Filesystem $files, Mobile_Detect $agent, Repository $config, ImageManager $manager, Application $application, ImagePaths $paths, ImageMacros $macros)

Create a new Image instance.

$this
make( mixed $image, null $output = null)

Make a new image instance.

string
path()

Return the path to an image.

macro($macro)

Run a macro on the image.

string
url( array $parameters = array(), null $secure = null)

Return the URL to an image.

string
image( null $alt = null, array $attributes = array())

Return the image tag to an image.

string
img( null $alt = null, array $attributes = array())

Return the image tag to an image.

string
picture( array $attributes = array())

Return a picture tag.

string
source()

Return a source tag.

String
encode( null $format = null, int $quality = null)

Return the image response.

string
output()

Return the output.

$this
rename($filename = null)

Set the filename.

$this
quality($quality)

Set the quality.

width( null $width = null)

Set the width attribute.

height( null $height = null)

Set the height attribute.

$this
setQuality($quality)

Set the quality.

$this
attr($attribute, $value)

Set an attribute value.

array
srcset()

Return the image srcsets by set.

$this
srcsets( array $srcsets)

Set the srcsets/alterations.

$this
sources( array $sources, bool $merge = true)

Set the sources/alterations.

$this
agents( array $agents, bool $exit = false)

Alter the image based on the user agents.

$this
setImage($image)

Set the image.

FileInterface|Image
getImage()

Get the image instance.

null|string
getFilename()

Get the file name.

$this
setFilename($filename = null)

Set the file name.

array
getAlterations()

Get the alterations.

$this
setAlterations( array $alterations)

Set the alterations.

$this
addAlteration($method, $arguments = array())

Add an alteration.

array
getAttributes()

Get the attributes.

$this
setAttributes( array $attributes)

Set the attributes.

array
getSrcsets()

Get the srcsets.

$this
setSrcsets( array $srcsets)

Set the srcsets.

array
getSources()

Get the sources.

$this
setSources( array $sources)

Set the sources.

int
getQuality( null $default = null)

Get the quality.

$this
setOutput($output)

Set the output mode.

null|string
getExtension()

Get the extension.

$this
setExtension($extension)

Set the extension.

array
getAllowedMethods()

Get the allowed methods.

$this
addPath($namespace, $path)

Add a path by it's namespace hint.

int|null
getWidth()

Get the width.

$this
setWidth($width)

Set the width.

int|null
getHeight()

Get the height.

$this
setHeight($height)

Set the height.

string
__toString()

Return the output.

$this|mixed
__call($name, $arguments)

If the method does not exist then add an attribute and return.

Details

at line 219
__construct( UrlGenerator $url, HtmlBuilder $html, Filesystem $files, Mobile_Detect $agent, Repository $config, ImageManager $manager, Application $application, ImagePaths $paths, ImageMacros $macros)

Create a new Image instance.

Parameters

UrlGenerator $url
HtmlBuilder $html
Filesystem $files
Mobile_Detect $agent
Repository $config
ImageManager $manager
Application $application
ImagePaths $paths
ImageMacros $macros

at line 249
$this make( mixed $image, null $output = null)

Make a new image instance.

Parameters

mixed $image
null $output

Return Value

$this

at line 278
string path()

Return the path to an image.

Return Value

string

at line 292
Image macro($macro)

Run a macro on the image.

Parameters

$macro

Return Value

Image

at line 305
string url( array $parameters = array(), null $secure = null)

Return the URL to an image.

Parameters

array $parameters
null $secure

Return Value

string

at line 318
string image( null $alt = null, array $attributes = array())

Return the image tag to an image.

Parameters

null $alt
array $attributes

Return Value

string

at line 342
string img( null $alt = null, array $attributes = array())

Return the image tag to an image.

Parameters

null $alt
array $attributes

Return Value

string

at line 354
string picture( array $attributes = array())

Return a picture tag.

Parameters

array $attributes

Return Value

string

at line 381
string source()

Return a source tag.

Return Value

string

at line 402
String encode( null $format = null, int $quality = null)

Return the image response.

Parameters

null $format
int $quality

Return Value

String

at line 414
string output()

Return the output.

Return Value

string

at line 425
$this rename($filename = null)

Set the filename.

Parameters

$filename

Return Value

$this

at line 436
$this quality($quality)

Set the quality.

Parameters

$quality

Return Value

$this

at line 447
Image width( null $width = null)

Set the width attribute.

Parameters

null $width

Return Value

Image

at line 458
Image height( null $height = null)

Set the height attribute.

Parameters

null $height

Return Value

Image

at line 469
$this setQuality($quality)

Set the quality.

Parameters

$quality

Return Value

$this

at line 598
$this attr($attribute, $value)

Set an attribute value.

Parameters

$attribute
$value

Return Value

$this

at line 610
array srcset()

Return the image srcsets by set.

Return Value

array

at line 628
$this srcsets( array $srcsets)

Set the srcsets/alterations.

Parameters

array $srcsets

Return Value

$this

at line 657
$this sources( array $sources, bool $merge = true)

Set the sources/alterations.

Parameters

array $sources
bool $merge

Return Value

$this

at line 693
$this agents( array $agents, bool $exit = false)

Alter the image based on the user agents.

Parameters

array $agents
bool $exit

Return Value

$this

at line 727
$this setImage($image)

Set the image.

Parameters

$image

Return Value

$this

at line 847
FileInterface|Image getImage()

Get the image instance.

Return Value

FileInterface|Image

at line 857
null|string getFilename()

Get the file name.

Return Value

null|string

at line 868
$this setFilename($filename = null)

Set the file name.

Parameters

$filename

Return Value

$this

at line 884
array getAlterations()

Get the alterations.

Return Value

array

at line 895
$this setAlterations( array $alterations)

Set the alterations.

Parameters

array $alterations

Return Value

$this

at line 909
$this addAlteration($method, $arguments = array())

Add an alteration.

Parameters

$method
$arguments

Return Value

$this

at line 921
array getAttributes()

Get the attributes.

Return Value

array

at line 932
$this setAttributes( array $attributes)

Set the attributes.

Parameters

array $attributes

Return Value

$this

at line 958
array getSrcsets()

Get the srcsets.

Return Value

array

at line 969
$this setSrcsets( array $srcsets)

Set the srcsets.

Parameters

array $srcsets

Return Value

$this

at line 981
array getSources()

Get the sources.

Return Value

array

at line 992
$this setSources( array $sources)

Set the sources.

Parameters

array $sources

Return Value

$this

at line 1005
int getQuality( null $default = null)

Get the quality.

Parameters

null $default

Return Value

int

at line 1020
$this setOutput($output)

Set the output mode.

Parameters

$output

Return Value

$this

at line 1032
null|string getExtension()

Get the extension.

Return Value

null|string

at line 1044
$this setExtension($extension)

Set the extension.

Parameters

$extension

Return Value

$this

at line 1056
array getAllowedMethods()

Get the allowed methods.

Return Value

array

at line 1069
$this addPath($namespace, $path)

Add a path by it's namespace hint.

Parameters

$namespace
$path

Return Value

$this

at line 1081
int|null getWidth()

Get the width.

Return Value

int|null

at line 1092
$this setWidth($width)

Set the width.

Parameters

$width

Return Value

$this

at line 1104
int|null getHeight()

Get the height.

Return Value

int|null

at line 1115
$this setHeight($height)

Set the height.

Parameters

$height

Return Value

$this

at line 1148
string __toString()

Return the output.

Return Value

string

at line 1166
$this|mixed __call($name, $arguments)

If the method does not exist then add an attribute and return.

Parameters

$name
$arguments

Return Value

$this|mixed