footer_submit(), header_submit() table()
A submit button below or above a table that holds a form (inputs, check boxes in the rows).
table()->footer_submit($name = '', $extra = [])
table()->header_submit($name = '', $extra = [])Options
| Option | Meaning |
|---|---|
$name | Button text and name; default Submit; the options array may come first. |
value, desc | Posted value; shown text. |
icon, class, a_class | Icon (default CLASS_ICON_SAVE) and classes. |
copy_to_header, copy_to_footer | Show it in both places. |
Example
Code
$rows = [
1 => ['id' => 1, 'name' => 'Desk lamp', 'price' => '24.90'],
2 => ['id' => 2, 'name' => 'Office chair', 'price' => '149.00'],
];
return table($rows, ['no_pages' => 1])
->form()
->text('name')
->input('price')
->header_submit('Save prices')
->footer_submit('Save prices', ['class' => 'btn btn-primary btn-sm']);Notes
- Use it with form(): the button posts the inputs of the rows (
price[1],price[2]...).
See also: table/form, table/input