summaryrefslogtreecommitdiff
path: root/app/Helper/Form.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper/Form.php')
-rw-r--r--app/Helper/Form.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/Helper/Form.php b/app/Helper/Form.php
index 83e3b113..a37cc81a 100644
--- a/app/Helper/Form.php
+++ b/app/Helper/Form.php
@@ -104,6 +104,26 @@ class Form extends \Core\Base
}
/**
+ * Display a checkboxes group
+ *
+ * @access public
+ * @param string $name Field name
+ * @param array $options Options
+ * @param array $values Form values
+ * @return string
+ */
+ public function checkboxes($name, array $options, array $values = array())
+ {
+ $html = '';
+
+ foreach ($options as $value => $label) {
+ $html .= $this->checkbox($name.'['.$value.']', $label, $value, isset($values[$name]) && in_array($value, $values[$name]));
+ }
+
+ return $html;
+ }
+
+ /**
* Display a checkbox field
*
* @access public