MaxWords

Checks if the number of words in the value equals or is below the given maximum

  • since: Kirby 2.3.0
  • return (boolean)

In your code

if(v::maxWords('Lorem ipsum dolor sit amet.', 10)) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      maxWords: 10