Name |
Type |
Default |
Description |
$props |
array |
– |
|
Kirby\Cms\File
Type |
Description |
Kirby\Exception\InvalidArgumentException |
|
Kirby\Exception\LogicException |
|
Property |
Type |
Description |
---|
blueprint |
array |
Blueprint definition |
content |
array |
Field values |
filename |
string |
Field values |
parent*
|
Kirby\Cms\Model |
$site , $page or $user
|
root |
string |
|
source*
|
string |
|
template |
string |
|
translations |
array |
Language codes with subarrays of field values |
url |
string |
|
$file = File::create([
'source' => kirby()->root('assets').'/images/some-image.jpg',
'parent' => page('photography')->children()->listed()->first(),
'filename' => 'new-image.jpg',
'template' => 'cover',
'content' => [
'caption' => 'A nice view from above',
]
]);
kirby/src/Cms/FileActions.php#L168