I’m trying to echo the date of the last changes of my contents textfile. But
echo $page->textfile()->modified('%d. %B %Y')
ends in an “Call to a member function modified() on string” error.
What’s the correct way to show the date of the last changes of the contents textfile?
Thanks in advance.
Unfortunately that doesn’t work. Seems like it shows the last modified date of the contents folder but not of the textfile inside.
Well, as far as I recall, Kirby modifies the folder date when you safe through the Panel, not the actual text file.
So what are you actually trying to get? The date attached to the textfile in the filesystem? Then you have to use the
modified() method of the Toolkit’s F class
I got it:
<?= date('d. M. Y', filemtime( $page->textfile())); ?>
I didn’t use the Panel. So only the textfile get’s modified.