Skip to content

Kirby 3.8.4

$kirby->snippet()

Uses the snippet component to create and return a template snippet

$kirby->snippet(mixed $name, array|object $data = [ ], bool $return = true): string|null

Parameters

Name Type Default Description
$name * mixed
$data array|object [ ] Variables or an object that becomes $item
$return bool true On false, directly echo the snippet

Return type

string|null

Parent class

Kirby\Cms\App