asset()
Helper to create an asset object
asset(string $path): Kirby\Filesystem\Asset
Parameters
Name | Type | Default |
---|---|---|
$path * | string |
– |
Return type
Example
<?php if ($asset = asset('assets/images/logo.svg')): ?>
<img src="<?= $asset->url() ?>" alt="">
<?php endif ?>