MinWords

Checks if the number of words in the value equals or is greater than the given minimum

  • since: Kirby 2.3.0
  • return (boolean)

In your code

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

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      minWords: 5