From 528f8c82f3da0b754296ffc6a06c2933b825f463 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Thu, 22 Aug 2013 15:55:34 -0400 Subject: [PATCH] Fixes #795: do not generate form-control css class for file input as it would display an unneeded border. --- framework/yii/widgets/ActiveField.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/yii/widgets/ActiveField.php b/framework/yii/widgets/ActiveField.php index e3ac6af..00a28df 100644 --- a/framework/yii/widgets/ActiveField.php +++ b/framework/yii/widgets/ActiveField.php @@ -323,7 +323,9 @@ class ActiveField extends Component */ public function fileInput($options = array()) { - $options = array_merge($this->inputOptions, $options); + if ($this->inputOptions !== array('class' => 'form-control')) { + $options = array_merge($this->inputOptions, $options); + } $this->parts['{input}'] = Html::activeFileInput($this->model, $this->attribute, $options); return $this; }