$site->createChild()
Creates a main page
$site->createChild(array $props): Kirby\Cms\Page
Parameters
Name | Type | Default |
---|---|---|
$propsrequired | array |
no default value |
Return type
This method modifies the existing $site
object it is applied to and returns it again.
Parent class
Examples
Programmatically create a new page as child of the $site
object.
$kirby->impersonate('kirby');
$newPage = $site->createChild(
[
'slug' => 'blog',
'template' => 'blog',
'isDraft' => false,
'content' => [
'title' => 'Blog',
]
]
);