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
| Option | Meaning |
|---|---|
$link | URL; rewrite (true, user, admin) passes it through url(). |
icon | Icon class; default CLASS_ICON_BTN. |
class, a_class, class_add, no_ajax, title | As for btn(). |
display_in | header or footer. |
copy_to_header, copy_to_footer | Show the link in both places. |
Example
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