I’d like to overwrite the toString
method of my custom field so I can modify the output of $page->myfield()
without the need of a custom field method. Is that possible somehow?
Registering a custom field seems to always use the Kirby\Content\Field
class. I don’t think overwriting the Field class directly is a good idea and I couldn’t find a way of using my own field class.
$field = $page->myfield();
echo get_class($field);
// Kirby\Content\Field