Skip to content

Page::factory()

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

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

Parameters

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

Kirby\Cms\Page

This method does not modify the existing $page object but returns a new object with the changes applied. Learn more →

Parent class

Kirby\Cms\Page