$page->increment($field, $by = 1, $max = null)

Increment a field value by one or a given value

  • since: Kirby 2.3.0
  • $field (string)
    A field name
  • $by (integer)
    An integer by which to increment
  • $max (integer)
    The max number
  • return ($page)

Example

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