allow_deny() table()
Show a 0 / 1 field as a disabled Allow or Deny button.
table()->allow_deny($name, $extra = [])Options
| Option | Meaning |
|---|---|
(common options) | The common column options. |
Example
| IP or network | Allow |
|---|---|
| 10.0.0.0/8 | |
| 192.0.2.10 |
Code
$rows = [
1 => ['id' => 1, 'ip' => '10.0.0.0/8', 'allow' => 1],
2 => ['id' => 2, 'ip' => '192.0.2.10', 'allow' => 0],
];
return table($rows, ['no_pages' => 1])
->text('ip', 'IP or network')
->allow_deny('allow');Notes
- The labels come from the
pair_allow_denydata handler, translated.
Bootstrap 3 and 5
Bootstrap 5 gets its own button classes for the pair (html()->_bs5_btn_html()).
See also: table/yes_no, form/active_box, html/button_yes_no_box