I want to make a page where I can present de EXIF data of a photo.
Therefore a tried to make a plugin according to the plugin recipe. Plugin Recipes | Grav Documentation.
I left the example.php unchanged.
I adjusted the ExampleTwigExtension.php. in particular the public function exampleFunction()
public function exampleFunction()
{
$image_file = 'test.jpeg'
$exif = exif_read_data($image_file, 0, true);
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
echo "$key.$name: $val \n";
}
}
return;
}
In the pageheader I set:
process:
twig: true
In the page I use {{ example() }} to present the EXIF data. This is however the intention.
I am almost certain that the php code is incorrect. I don’t know exactly which one should be. Can anyone help me?
Thank you.
Peter