diff options
author | Derek Jones <derek.jones@ellislab.com> | 2009-04-08 18:14:17 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2009-04-08 18:14:17 +0200 |
commit | 26399298164f1fb6eaa4764b543b876766dacf0a (patch) | |
tree | baa727ad02f67946125dd0392463b23c704f376e /system | |
parent | 57fe41072c9d97d3cba2cd5faef529ac94571bfb (diff) |
added form_multiselect() to form helper to make it easier to create multiselect fields, and to make it a bit more semantically correct to boot
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/form_helper.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 0173340c5..4716e4975 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -247,6 +247,31 @@ if ( ! function_exists('form_textarea')) // ------------------------------------------------------------------------ /** + * Multi-select menu + * + * @access public + * @param string + * @param array + * @param mixed + * @param string + * @return type + */ +if (! function_exists('form_multiselect')) +{ + function form_multiselect($name = '', $options = array(), $selected = array(), $extra = '') + { + if ( ! strpos($extra, 'multiple')) + { + $extra .= ' multiple="multiple"'; + } + + return form_dropdown($name, $options, $selected, $extra); + } +} + +// -------------------------------------------------------------------- + +/** * Drop-down Menu * * @access public |