yfix.net
  • Home
  • Docs
  • Table
  • Slate
    • bootstrap
    • cyborg
    • slate
  • Overview
  • Install
  • Demos
  • Forms
  • Tables
  • admin
  • allow_deny
  • auto
  • btn
  • btn_active
  • btn_edit
  • btn_func
  • check_box
  • column_options
  • data
  • date
  • footer_add
  • footer_link
  • footer_submit
  • form
  • func
  • htmx
  • icon
  • image
  • input
  • lang
  • link
  • on_post
  • radio_box
  • render
  • rownum
  • select_box
  • stars
  • table
  • text
  • text_padded
  • tpl_row
  • tr
  • user
  • yes_no
  • HTML widgets
  • htmx
  • Misc

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

OptionMeaning
$nameButton text and name; default Submit; the options array may come first.
value, descPosted value; shown text.
icon, class, a_classIcon (default CLASS_ICON_SAVE) and classes.
copy_to_header, copy_to_footerShow it in both places.

Example

Name Price
Desk lamp
Office chair

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