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