Цю сторінку ще не перекладено українською, тому нижче англійська версія.

user() table()

Show user ids as links with the login (or name, email, phone) of each user, loaded in one query.

table()->user($name = '', $extra = [])

Опції

ОпціяЗначення
linkLink of each user; default url_admin('/members/edit/%d').
nameField holding the ids (when the first argument is the options array).

Приклад

Цей приклад читає базу даних: він виконується лише в документації адмінки.

Код

$rows = [
    1 => ['id' => 1, 'title' => 'First post', 'user_id' => 1],
    2 => ['id' => 2, 'title' => 'Shared draft', 'user_id' => '1,2'],
];
return table($rows, ['no_pages' => 1])
    ->text('title')
    ->user('user_id', ['desc' => 'Author']);

Примітки

  • The field may hold one id, an array of ids or a comma-separated list; an unknown id prints the id.
  • Designed for the admin: it reads the user table.

Див. також: form/user_info