Skip to content

Kirby 4.5.0

$field->toUsers()

Returns a users collection from a yaml list of user email addresses in the field

$field->toUsers(string $separator = 'yaml'): Kirby\Cms\Users

Parameters

Name Type Default
$separator string 'yaml'

Return type

Kirby\Cms\Users

Example

<ul class="authors">
<?php foreach ($page->authors()->toUsers() as $author): ?>
    <li>
        <h2><?= $author->name() ?></h2>
        <?= $author->bio()->kirbytext() ?>
    </li>
<?php endforeach ?>
</ul>