$page->update()
Updates the page data
Parameters
Name | Type | Default |
---|---|---|
$input | array |null |
null |
$languageCode | string |null |
null |
$validate | bool |
false |
Return type
This method does not modify the existing $page
object but returns a new object with the changes applied. Learn more →
Parent class
Example
Kirby's objects are immutable. That means, when you modify an object like $page
, $file
etc. using a method like update()
, changeTitle()
and so on, a new object is returned. Therefore, you have to store the returned object in a new variable to be able to further work with it.
Updating a field by callback
Multi-language site
Use the optional $lang
parameter to specify the language you want to update.