Skip to content

Kirby 5.1.1

$site->visit()

Sets the current page by id or page object and returns the current page

$site->visit(Kirby\Cms\Page|string $page, string|null $languageCode = null): Kirby\Cms\Page

Parameters

Name Type Default
$pagerequired Kirby\Cms\Pageorstring no default value
$languageCode stringornull null

Return type

Kirby\Cms\Page

This method modifies the existing $site object it is applied to and returns it again.

Parent class

Kirby\Cms\Site

This method is usually only useful in the context of routing, especially in a multi-language setup. See the routing docs.