Hi, I created a little Kirbytext tag that lets you include a html file from your file list. It works like this:
site/tags/include.php
kirbytext::$tags['include'] = array(
'attr' => array(
'include'
),
'html' => function($tag) {
$filename = $tag->attr('include');
if($path = $tag->file($filename)){
return $path->read();
}
}
);
So with the tag (include: filename.html) you can include any html file, that you previously added to your pages filelist.
But now, I also wanted to expand the tag, so that it also could include a php file, and of course also processes the php code. Is that possible? I didn’t find a matching method in the cheatsheet.
Any ideas how to do it?