yfix.net
  • Home
  • Docs
  • Table
  • Slate
    • bootstrap
    • cyborg
    • slate
  • Overview
  • Install
  • Demos
  • Forms
  • Tables
  • HTML widgets
  • htmx
  • Misc
  • Plugins

footer_add(), header_add() table()

The Add button below or above the table: a footer_link() with the add link, icon and ajax class.

table()->footer_add($name = '', $link = '', $extra = [])
table()->header_add($name = '', $link = '', $extra = [])

Options

OptionMeaning
$nameDefault add; the options array may come first.
$linkDefault url('/@object/add').
no_ajaxNo ajax_add class.
(link options)Every option of footer_link().

Example

add
No records
New product

Code

return table([], ['no_records_simple' => 1])
    ->text('name')
    ->header_add(['link' => '#add-top', 'no_ajax' => 1])
    ->footer_add('New product', '#add', ['no_ajax' => 1]);

See also: table/footer_link, table/btn_edit