Update to Kirby 5

This commit is contained in:
Paul Nicoué 2025-07-11 14:41:34 +02:00
parent 5d9979fca8
commit 0fefc5e2e1
472 changed files with 30853 additions and 10301 deletions

View file

@ -2,6 +2,7 @@
use Kirby\Cms\App;
use Kirby\Cms\Blocks;
use Kirby\Cms\Collection;
use Kirby\Cms\File;
use Kirby\Cms\Files;
use Kirby\Cms\Html;
@ -80,7 +81,9 @@ return function (App $app) {
$message .= ' on parent "' . $parent->title() . '"';
}
throw new InvalidArgumentException($message);
throw new InvalidArgumentException(
message: $message
);
}
},
@ -130,6 +133,18 @@ return function (App $app) {
return Str::date($time, $format);
},
/**
* Parse yaml entries data and convert it to a
* collection of field objects
*/
'toEntries' => function (Field $field): Collection {
$entries = new Collection(parent: $field->parent());
foreach ($field->yaml() as $index => $entry) {
$entries->append(new Field($field->parent(), $index, $entry));
}
return $entries;
},
/**
* Returns a file object from a filename in the field
*/
@ -266,7 +281,9 @@ return function (App $app) {
$message .= ' on parent "' . $parent->id() . '"';
}
throw new InvalidArgumentException($message);
throw new InvalidArgumentException(
message: $message
);
}
},