Skip to content



Constructs a Page object and also takes page models into account.

Page::factory(mixed $props): Kirby\Cms\Page


Name Type Default
$props * mixed

For the $props parameter, you pass an array with the following data, which will be used to set up the Kirby\Cms\Page object:

Name Type Description
blueprint array Sets the Blueprint object
children array Sets the Children collection
content array Sets the Content object
dirname string Sets the dirname manually, which works
more reliable in connection with the inventory
than computing the dirname afterwards
drafts array Sets the Drafts collection
files array Sets the Files collection
isDraft bool Sets the draft flag
num int Sets the sorting number
parent Kirby\Cms\Page Sets the parent page object
root string Sets the absolute path to the page
slug * string Sets the required Page slug
template string Sets the intended template
translations array Create the translations collection from an array
url string Sets the Url

Return type


Parent class