<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lukaskleinschmidt / kirby-snippet-controller example snippets
// header.controller.php
// The return value can be a callback
return function ($site) {
return [
'title' => $site->title(),
];
};
// Or you can simply return an array.
return [
'title' => site()->title(),
];
Kirby::plugin('superwoman/superplugin', [
'snippets' => [
// Refer to a file
'header.controller' => __DIR__ . '/snippets/header.controller.php',
// Return an array
'header.controller' => [
'title' => site()->title(),
],
// Return a callback
'header.controller' => function ($site) {
return [
'title' => $site->title(),
];
},
],
]);