Skip to content

Kirby 6.0.0

new Snippet()

Creates a new snippet

new Snippet(string|null $file, array $data = [])

Parameters

Name Type Default Description
$file stringornull no default value Full path to the PHP file of the snippet; can be null for "dummy" snippets that don't exist
$data array [] Associative array with variables that will be set inside the snippet

Parent class

Kirby\Template\Snippet