Reference

Guide

Page::create()

Creates and stores a new page

Page::create(array $props): Kirby\Cms\Page

Parameters

Name Type Default Description
$props array

Return type

Kirby\Cms\Page

The $props parameter

Property Type
slug string
url string
template string
model string
num mixed
draft bool
content array

Example

$page = Page::create([
  'slug'     => 'a-new-article',
  'template' => 'article',
  'content' => [
    'title'  => 'A new article',
    'author' => 'Homer Simpson'
  ]
]);

Source code

kirby/src/Cms/PageActions.php#L382