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

footer_link(), header_link() table()

A link button below (footer_link) or above (header_link) the table.

table()->footer_link($name, $link, $extra = [])
table()->header_link($name, $link, $extra = [])

Options

OptionMeaning
$linkURL; rewrite (true, user, admin) passes it through url().
iconIcon class; default CLASS_ICON_BTN.
class, a_class, class_add, no_ajax, titleAs for btn().
display_inheader or footer.
copy_to_header, copy_to_footerShow the link in both places.

Example

Export CSV Import
Name
Desk lamp
Import

Code

$rows = [1 => ['id' => 1, 'name' => 'Desk lamp']];
return table($rows, ['no_pages' => 1])
    ->text('name')
    ->header_link('Export CSV', '#export', ['icon' => 'fa fa-download'])
    ->footer_link('Import', '#import', ['icon' => 'fa fa-upload', 'copy_to_header' => 1]);

Notes

  • The links show above and below an empty table too.
  • The name is translated with t().

See also: table/footer_add, table/footer_submit