Skip to content

2.2.0

Latest
Compare
Choose a tag to compare
@lukaskleinschmidt lukaskleinschmidt released this 06 Nov 15:25

Added option to prevent a snippet from rendering

Using the snippet_prevent() function in your controller callback can now prevent a snippet from being rendered.

snippet('header', data: ['size' => $page->size()])

// header.controller.php

return function (Field|string $size = null) {
    if (is_null($size)) {
        snippet_prevent();
    }

    return [
        'size' => $size,
    ];
};