Skip to content

Kirby 5.0.4

$page->changeTemplate()

Changes the page template

$page->changeTemplate(string $template): Kirby\Cms\Page

Parameters

Name Type Default
$templaterequired string no default value

Return types

Kirby\Cms\Page

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

Exceptions

Type Description
Kirby\Exception\LogicException If the textfile cannot be renamed/moved

Parent class

Kirby\Cms\Page

Details

Changing the page template can lead to unwanted data loss. Always make sure you have a backup of your data before using this method.