Call field with "-" within there names

field

#1

Ahoy Kirbyans,
I am implementing a few indieweb features in my site, like microformats, micropub and microsub. But if I use a publisher it creates fields with “-” within there names. For example this:
Repost-of

But I can’t call fields with “-” within. if I do this I will get an error.

This:
$article->Repost-of()

Will get this:
Undefined property: Page::$Repost

(You can have a look at debugger: https://www.niklasjordan.com/blog/notes/)

So, how can I call these fields with a “-” within there names? Are there any solutions for this problem?


#2

You have. to use an underscore, dashes are not allowed in PHP method/function names.

While Kirby puts a dash in the text file, you can just ignore that.


#3

It works :wink: What a simple solution! Thanks for your help.