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_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