summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornihaopaul <nihaopaul@gmail.com>2012-03-12 09:46:58 +0100
committernihaopaul <nihaopaul@gmail.com>2012-03-12 09:46:58 +0100
commit0ba29f5aa019b9c4a002fbecacf6ed33f3b68a3d (patch)
tree5eb2db9a0f35f400004dcd528cc65fea6842a25a
parent3d933b6fad72d4b92f18187dd57f1d3c35f8936a (diff)
form_dropdown() will now also take an array for unity with other form helpers.
-rw-r--r--system/helpers/form_helper.php17
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 18 insertions, 0 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 4da07f283..9610cee98 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -314,6 +314,23 @@ 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) ) {
+ if ( ! isset($name['options']))
+ {
+ $name['selected'] = false;
+ }
+ if ( ! isset($name['selected']))
+ {
+ $name['selected'] = false;
+ }
+ if ( ! isset($name['extra']))
+ {
+ $name['extra'] = false;
+ }
+ 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 139899af0..f462e1b11 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -44,6 +44,7 @@ Release Date: Not Released
- 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