snippet()
Embeds a snippet from the snippet folder
Parameters
Name | Type | Default |
---|---|---|
$name * | string |array |
– |
$data | array |object |
[ ] |
$return | bool |
false |
Return type
string
Example
Snippet alternatives
Since 3.2.0
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: