Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

PHP: modified()

Bruno Meilick edited this page Mar 4, 2020 · 1 revision

The modified() helper lets you retrieve the modified timestamp from the AutoID database without requiring the file to be checked on disk. It even works for Collections of Pages/Files that have Objects with and without an autoid.

// string
$modified = modified($autoid); // null or int
// array of strings
$modified = modified([$autoid1, $autoid2, $autoid3]); // null or int

Kirby will retrieve the modified timestamp for all files in a collection in reading them from the disk, but the modified() helper is still a nice way to get the max value easily.

// collection object
$modified = modified(site()->pages()->index()); // null or int

If available this helper is used in the Lapse plugin to make it blazing fast.

Clone this wiki locally