I would like to set up a route that renders “data” fetched in the route (or in a controller) but without polluting the content folder with an empty content/{foldername}/template.md.
I’m not sure if this is clear; let me elaborate. I have this, and it works:
I have:
- in /content I have a directory “bar” which has an empty demo.md file in it
- a demo template which simply echoes $foo
- following route in my /site/config/config.php
c::set('routes', array(
array(
'pattern' => '(:any)/foo/(:any)',
'action' => function($lang, $param) {
site()->visit('bar', $lang);
$page = page('bar');
$data = array(
'foo' => $param
);
return array('bar', $data);
}
)
));
Now on to the question: is there a way to achieve the same, but without the necessity of the “bar” folder in /content ?
Thanks!