I’m trying to perform calculations on the front-end of my Kirby website with php, it’s working well so far. <p><?= round(($ServicesTotalCost + $FeesTotalCost) * 0.40) ?><?= $page->currency() ?></p>
I ultimately want to store this calculated value in the Kirby back-end as a field so I can use it later. I’m unsure if the fileMethods approach is best for this purpose since I’m not manipulating a file.**
As simple as it seems, I’m not even able to display a simple test string in the info field…
My info field
fields:
info:
label: Total
type: info
text: "{{ getLink }}"
index.php of my plugin
<?php
Kirby::plugin('conv/CV', [
'fileMethods' => [
'getLink' => function () {
return 'test';
}
],
]);