Image
The image
function returns an instance of Anomaly\Streams\Platform\Image\Image
for altering and displaying images. For more information please see the Image documentation.
Introduction
This section will introduce you to the basics of using the image functions and how to alter and output images.
img
The img
function is an alias to the image
function described below.
image
The image
method makes a new instance of the Image
class. The output for this function is tag
by default which renders the entire image tag.
Returns: \Anomaly\Streams\Platform\Image\Image
Arguments
Key | Required | Type | Default | Description |
---|---|---|---|---|
$source |
true |
mixed |
none |
The source to make the image from. |
Twig
{{ image('theme::img/logo.jpg')|raw }}
{{ image('theme::img/logo.jpg').resize(1000).quality(60)|raw }}
image_path
The image_path
method makes a new instance of the Image
class. The output for this function is path
by default which renders the relative image path.
Returns: \Anomaly\Streams\Platform\Image\Image
Arguments
Key | Required | Type | Default | Description |
---|---|---|---|---|
$source |
true |
mixed |
none |
The source to make the image from. |
Twig
{{ image_path('theme::img/logo.jpg') }}
{{ image_path('theme::img/logo.jpg').fit(500, 500) }}