snippet()
Embeds a snippet from the snippet folder
Parameters
Name | Type | Default |
---|---|---|
$name * | string |array |
– |
$data | array |object |
[ ] |
$return | bool |
false |
Return type
string
|null
Example
Snippet alternatives
You can define an array of snippet alternatives if the first snippet cannot be found:
This is useful if you want to provide fallbacks for a snippet based on page input, in case the snippet does not exist: