2.1.0
Updating variables when using a controller callback
Controller callbacks will now override variables.
snippet('header', data: ['size' => $page->size()])
// header.controller.php
return function (Field|string $size = null) {
if ($size instanceof Field) {
$size = $size->value();
}
$size = match ($size) {
'small' => 'height: 50vh',
'medium' => 'height: 80vh',
default => 'height: 100vh',
};
return [
'size' => $size,
];
};Full Changelog: 2.0.1...2.1.0