Skip to content

Kirby 5.0.4

image()

Return an image from any page specified by the path

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

Parameters

Name Type Default
$path stringornull null

Return types

Kirby\Cms\Fileornull

Examples

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() ?>