Image

Type
Class
Namespace
craft\web\twig\variables
Inherits
craft\web\twig\variables\Image
Since
3.0

Class Image variable.

View source

Protected Properties

PropertyDescription
$pathstring, null
$size
$urlstring, null

$path

Signature

protected string, null $path = null

$size

Signature

protected  $size = null

$url

Signature

protected string, null $url = null

Public Methods

MethodDescription
__construct()Constructor
getHeight()Returns the image's height.
getSize()Returns an array of the width and height of the image.
getUrl()Returns the image's URL.
getWidth()Returns the image's width.

__construct()

Constructor

View source

Arguments

Signature

public void __construct ( \craft\web\twig\variables\string $path, \craft\web\twig\variables\string $url = '' )

getHeight()

Returns the image's height.

View source

Returns

integer

Signature

public integer getHeight ( )

getSize()

Returns an array of the width and height of the image.

View source

Returns

array

Signature

public array getSize ( )

getUrl()

Returns the image's URL.

View source

Returns

string

Signature

public string getUrl ( )

getWidth()

Returns the image's width.

View source

Returns

integer

Signature

public integer getWidth ( )