Hello,
I assumed I could have several page methods defined in a single plugin file, like this:
<?php
Kirby::plugin('my/page-methods', [
'pageMethods' => [
'oneMethod' => function () {
...
},
'anotherMethod' => function () {
...
},
etc...
]
]);
But that does not seem to work. Can you please confirm it does not ?
Also, I wonder if the folder and names the page method example in the guide uses are all variable or mandatory in some cases, I mean, in the example the page method plugin file is in:
site/plugins/page-methods/index.php
Is the folder name ‘page-methods’ completely arbitrary? could it be anything?
Also as seen above, the example uses this naming in the code:
<?php
Kirby::plugin('my/page-methods', [
'pageMethods' => [
'oneMethod' => function () {
I understand my/page-methods
can also change to anything like me/this-thing
And I understand that oneMethod
can change
But is pageMethods
a mandatory name to use in order to extend the page object?
Thank you