I’m trying to write a plugin with a virtual page. This plugin use a custom template (plugins/myplugin/templates/virutal.php) to display a simple text. The problem is that the template isn’t loaded but the “site/template/default.php” is applied instead. Please could you let me know what I’m missing in the below code:
'routes' => [
// virtual page
[
'pattern' => 'virtual',
'action' => function () {
return Page::factory([
'slug' => 'virtual',
'template' => __DIR__ . '/templates/virtual.php',
'model' => 'virtual',
'content' => [
'title' => 'This is not a real page',
'date' => '2019-05-01',
'text' => 'The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.'
]
]);
},
],
Thanks in advance for your help