Skip to content

Kirby 4.4.1

Asset methods

Asset methods are registered with the assetMethods extension.

They are used for all Kirby/Filesystem/Asset objects returned by the asset() helper whenever there is no built-in method with the same name.

Default asset methods

For a full list of default asset methods, please check out the Reference.

Be aware that you cannot override these default asset methods with any custom asset method.

Getting started

You can extend the set of defined asset methods in a plugin file.

/site/plugins/asset-methods/index.php
Kirby::plugin('my/plugin', [
    'assetMethods' => [
         'yourMethodName' => function () {
            // ...
        }
    ]
]);