Reference

Guide

File models

File models are registered with the fileModels extension.

File models extend Kirby's default file object. Methods that you define in a file model are available everywhere in Kirby where you call a file of that type.

/site/plugins/file-models/index.php
class CoverFile extends File
{
    // ...
}

Kirby::plugin('my/plugin', [
    'fileModels' => [
        'cover' => 'CoverFile'
    ]
]);