Templates
Add your own template engine
class CustomTemplate extends Kirby\Cms\Template {
}
Kirby::plugin('my/template', [
'components' => [
'template' => function (Kirby $kirby, string $name, string $contentType = null) {
return new CustomTemplate($name, $contentType);
}
]
]);
Parameters
Name | Type | Default | Description |
---|---|---|---|
$kirby |
Kirby\Cms\App |
– | Kirby instance |
$name |
string |
– | Template name |
$type |
string |
'html' |
Extension type |
$defaultType |
string |
'html' |
Default extension type |