Skip to content

Kirby 3.5.7.1

$field->words()

Returns the number of words in the text

$field->words()

Example

<?= $page->text()->kirbytext() ?>

<dl class="text-stats">

  <dt>Characters</dt>
  <dd><?= $page->text()->length() ?></dd>

  <dt>Words</dt>
  <dd><?= $page->text()->words() ?></dd>

</dl>