Skip to content

Kirby 4.4.1

image()

Return an image from any page specified by the path

image(?string $path = null): Kirby\Cms\File|null

Parameters

Name Type Default
$path string|null null

Return type

Kirby\Cms\File|null

Example

Fetching an image of the current page

<?= image('forrest.jpg')->url() ?>

Fetching an image from any other page

<?= image('projects/project-a/forrest.jpg')->url() ?>