$kirby->snippet()
Uses the snippet component to create and return a template snippet
$kirby->snippet(array|string|null $name, array|object $data = [ ], bool $return = true, bool $slots = false): Kirby\Template\Snippet|string|null
Parameters
Name | Type | Default | Description |
---|---|---|---|
$name | array orstring ornull |
no default value | |
$data | array orobject |
[ ]
|
Variables or an object that becomes $item |
$return | bool |
true
|
On false , directly echo the snippet |
$slots | bool |
false
|
Return types
Kirby\Template\Snippet
orstring
ornull
This method modifies the existing $app
object it is applied to and returns it again.