I like to create a new file if it does not exist and save some data of the blog in it.
Is there a way with kirby code (possibly createNewFilename(), which I did not manage to work)? Or is the only way by using PHP fopen?
The relevant code snippet so far:
$tagfile = $pages->find(c::get('blog', 'blog'))->files()->find('tags_do_not_delete.json'); if(!isset($tagfile)): $tagfile = ... endif; $blogdata = $tagfile->read('json');
I am really new with kirby and PHP but willing to learn a lot. So please be patient with me.