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

user_select_box() form()

A Select2 field that searches the site users through the form API endpoint; shows login and id.

form()->user_select_box($name, $values = null, $extra = [], $replace = [])

Опції

ОпціяЗначення
$valuesPreset id => label; the stored ids are labelled from the user table.
(select2 options)Every option of select2_box().

Приклад

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

Код

return form(['user_id' => 1])->user_select_box('user_id', null, ['desc' => 'Customer']);

Примітки

  • Designed for the admin: it reads the user table.

Див. також: form/select2_box, table/user