Consider a valid page with following slug blog/my-first-article that has a json content representation available next to the default html representation.
When using following code in a route: $p = page('blog/my-first-article.txt'), this returns the blog/my-first-article as $p. I can basically add anything behind a . and it still returns that page object. Is this expected? I would have expected a null tbh.
FYI: I currently worked around it like this
$p = null;
if (kirby()->call($slug)) {
$p = page($slug);
}
Is this “bullet proof”?
Thanks