$field->toPage()
Returns a page object from a page id in the field
$field->toPage(): Kirby\Cms\Page|null
Return types
Kirby\Cms\Page
ornull
This method modifies the existing $field
object it is applied to and returns it again.
Examples
<?php if ($related = $page->related()->toPage()): ?>
<p><a href="<?= $related->url() ?>">Read more…</a></p>
<?php endif ?>