Merge pull request #1173 from nihaopaul/develop
form_dropdown() will now also take an array for unity with other form he...
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 4da07f2..37337d9 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -314,6 +314,28 @@
{
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);
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 139899a..f462e1b 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -44,6 +44,7 @@
- Refactored ``plural()`` and ``singular()`` to avoid double pluralization and support more words.
- Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default).
- Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase.
+ - form_dropdown() will now also take an array for unity with other form helpers.
- Database