designtopack/public/site/plugins/helpers/index.php

17 lines
355 B
PHP
Raw Normal View History

2024-10-16 17:32:15 +02:00
<?php
function getFileData($file) {
$data = [
'url' => $file->url(),
'uuid' => (string) $file->uuid(),
'name' => $file->filename(),
'type' => (string) $file->type()
2024-10-16 17:32:15 +02:00
];
if ($file->description()->exists()) {
2024-10-16 17:57:50 +02:00
$data['description'] = $file->description()->value();
2024-10-16 17:32:15 +02:00
$data['tags'] = $file->tags()->split();
};
return $data;
}