Commit 4e1ab6e5 by Qiang Xue

Fixes #848: Added hidden field for Html::activeFileInput().

parent b16bf069
...@@ -1049,7 +1049,10 @@ class HtmlBase ...@@ -1049,7 +1049,10 @@ class HtmlBase
*/ */
public static function activeFileInput($model, $attribute, $options = array()) public static function activeFileInput($model, $attribute, $options = array())
{ {
return static::activeInput('file', $model, $attribute, $options); // add a hidden field so that if a model only has a file field, we can
// still use isset($_POST[$modelClass]) to detect if the input is submitted
return static::activeHiddenInput($model, $attribute, array('id' => null, 'value' => ''))
. static::activeInput('file', $model, $attribute, $options);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment