Skip to content

Kirby 5.0.4

$field->split()

Splits the field content into an array

$field->split($separator = ','): array

Parameters

Name Type Default
$separator mixed ','

Return type

array

This method modifies the existing $field object it is applied to and returns it again.

Examples

<h2>Tags</h2>
<ul>
  <?php foreach ($page->tags()->split(',') as $tag): ?>
  <li><?= $tag ?></li>
  <?php endforeach ?>
</ul>