$files->get()
Getter
$files->get(mixed $key, mixed $default = null): mixed
Parameters
Name | Type | Default |
---|---|---|
$key * | mixed |
– |
$default | mixed |
null |
Return type
mixed
Parent class
Kirby\Cms\Files
inherited from Kirby\Toolkit\Collection
Example
<?php
if ($file = $page->files()->get('photography/landscape/hobbits-and-stuff.jpg')):
echo $file->url();
endif;
?>