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

form() table()

Wrap the table in a form, so inputs, check boxes and selects in its rows post together.

table()->form($action = '', $method = '', $extra = [])

Опції

ОпціяЗначення
$actionForm action; default url('/@object/@action/@id'), this page.
$methodDefault POST.
forceReplace the form settings of an earlier call.

Приклад

Назва Сортування
Desk lamp
Office chair

Код

$rows = [
    1 => ['id' => 1, 'name' => 'Desk lamp', 'sort' => 10],
    2 => ['id' => 2, 'name' => 'Office chair', 'sort' => 20],
];
return table($rows, ['no_pages' => 1])
    ->form()
    ->check_box('id', ['desc' => ''])
    ->text('name')
    ->input('sort', ['class' => 'input-small'])
    ->footer_submit('Save order');

Примітки

Див. також: table/footer_submit, demo:table/form