Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function checkbox($attrs = [])
- {
- $attrs['type'] = 'checkbox';
- $attrs['value'] = 1;
- if (isset($attrs['name'])) {
- $name = $attrs['name'];
- if (isset($_REQUEST[$name]) and $_REQUEST[$name] == 1) {
- $attrs['checked'] = true;
- }
- $hidden = $this->hidden(['name' => $name, 'value' => '0']);
- } else {
- $hidden = '';
- }
- return $hidden . $this->open('input', $attrs);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement