Skip to content

Kirby 5.0.4

Page::factory()

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

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

Parameters

Name Type Default
$propsrequired mixed no default value

Return type

Kirby\Cms\Page

Parent class

Kirby\Cms\Page

Examples

$pageObject = Page::factory([
    'slug'     => 'new-page',
    'template' => 'default',
    'model'    => 'default',
    'content'  => [
        'title' => 'Shiny new page object',
        'date'  => '2032-05-01',
        'text'  => 'The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.'
    ]
]);