icon() table()
Show an icon from an icon class name (icon-*) or an image file of uploads/icons/.
table()->icon($name, $extra = [])Options
| Option | Meaning |
|---|---|
(common options) | The common column options. |
Example
Code
$rows = [
1 => ['id' => 1, 'name' => 'Home', 'icon' => 'icon-home'],
2 => ['id' => 2, 'name' => 'Settings', 'icon' => 'icon-cog'],
3 => ['id' => 3, 'name' => 'No icon', 'icon' => ''],
];
return table($rows, ['no_pages' => 1])
->icon('icon')
->text('name');Notes
- A value that is not an
icon-*class is looked up as a file inuploads/icons/of the project; a missing file prints nothing. - It also calls form().
See also: form/icon_select_box, html/icon