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
Parent class
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.'
]
]);