Craft 3 Class Reference

Class craft\web\twig\variables\Image

Inheritance
craft\web\twig\variables\Image
Available since version
3.0
Source Code
https://github.com/craftcms/cms/blob/master/src/web/twig/variables/Image.php

Class Image variable.

Protected Properties
Property Type Description Defined By
$path string, null craft\web\twig\variables\Image
$size craft\web\twig\variables\Image
$url string, null craft\web\twig\variables\Image
Public Methods
Method Description Defined By
__construct() Constructor craft\web\twig\variables\Image
getHeight() Returns the image's height. craft\web\twig\variables\Image
getSize() Returns an array of the width and height of the image. craft\web\twig\variables\Image
getUrl() Returns the image's URL. craft\web\twig\variables\Image
getWidth() Returns the image's width. craft\web\twig\variables\Image

Property Details

$path protected property #

protected string, null $path null

$size protected property #

protected  $size null

$url protected property #

protected string, null $url null

Method Details

__construct() public method #

Constructor

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

getHeight() public method #

Returns the image's height.

public integer getHeight ( )

getSize() public method #

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

public array getSize ( )

getUrl() public method #

Returns the image's URL.

public string getUrl ( )

getWidth() public method #

Returns the image's width.

public integer getWidth ( )