summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-12 10:23:43 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-12 10:23:43 +0100
commit5f98a1091c70e29c7596917604ec478aea443122 (patch)
tree754b63a98964d6767d8442ea83f865e7c87778fe /system
parent3d933b6fad72d4b92f18187dd57f1d3c35f8936a (diff)
parent08631577a008b0d7544c6092652f6140885298a5 (diff)
Merge pull request #1173 from nihaopaul/develop
form_dropdown() will now also take an array for unity with other form he...
Diffstat (limited to 'system')
-rw-r--r--system/helpers/form_helper.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 4da07f283..37337d975 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -314,6 +314,28 @@ if ( ! function_exists('form_dropdown'))
{
function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '')
{
+ // If name is really an array then we'll call the function again using the array
+ if (is_array($name) && isset($name['name']))
+ {
+
+ if ( ! isset($name['options']))
+ {
+ $name['options'] = array();
+ }
+
+ if ( ! isset($name['selected']))
+ {
+ $name['selected'] = array();
+ }
+
+ if ( ! isset($name['extra']))
+ {
+ $name['extra'] = '';
+ }
+
+ return form_dropdown($name['name'], $name['options'], $name['selected'], $name['extra']);
+ }
+
if ( ! is_array($selected))
{
$selected = array($selected);