Skip to content

2.1.0

Choose a tag to compare

@lukaskleinschmidt lukaskleinschmidt released this 18 Sep 12:15
· 1 commit to main since this release
57bcda1

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