Reference

Guide

$site->update()

Updates the model data

$site->update(array $input = null, string $languageCode = null, bool $validate = false): Kirby\Cms\Site

Parameters

Name Type Default Description
$input array null
$languageCode string null
$validate bool false

Return type

Kirby\Cms\Site

Example

try {

  $site->update([
    'title'       => 'My Site',
    'description' => 'it is really nice',
  ]);

  echo 'The site info has been updated';

} catch(Exception $e) {

  echo $e->getMessage();

}

Inherited from

Kirby\Cms\ModelWithContent

Source code

kirby/src/Cms/ModelWithContent.php#L607