btn_active() html()
A small green / yellow toggle button showing whether an item is active (table2 btn_active short).
html()->btn_active($url = '', $active = 0, $extra = [])Options
| Option | Meaning |
|---|---|
$url | Link of the toggle; default url('/@object/active/@id'). |
$active | 0 or 1. |
class, class_add, disabled | Classes (default change_active); disabled returns the colour class only. |
Example
Code
return html()->btn_active('#toggle-1', 1) . ' ' . html()->btn_active('#toggle-2', 0);See also: table/btn_active