Reference

Guide

$page->decrement()

Decrement a given field value

$page->decrement(string $field, int $by = 1, int $min = 0): Kirby\Cms\Page

Parameters

Name Type Default Description
$field string
$by int 1
$min int

Return type

Kirby\Cms\Page

Example

<?php $page->decrement('likes') ?>

Inherited from

Kirby\Cms\ModelWithContent

Source code

kirby/src/Cms/ModelWithContent.php#L201