Added missing activeSearchField() method to CHtml. And searchField() to ... #1980

Merged
merged 2 commits into from Mar 20, 2013

Projects

None yet

2 participants

@njasm
njasm commented Jan 14, 2013

...CActiveForm. For creation of HTML input field of type SEARCH, that fixes #1743 and updates (the not merged) pull request #1900

@njasm njasm Added missing activeSearchField() method to CHtml. And searchField() …
…to CActiveForm. For creation of HTML input field of type search, that fixes #1743
84bb237
@njasm njasm closed this Jan 14, 2013
@njasm njasm reopened this Jan 14, 2013
@resurtm resurtm commented on an outdated diff Mar 9, 2013
framework/web/helpers/CHtml.php
+ * @param CModel $model the data model
+ * @param string $attribute the attribute
+ * @param array $htmlOptions additional HTML attributes. Besides normal HTML attributes, a few special
+ * attributes are also recognized (see {@link clientChange} and {@link tag} for more details.)
+ * @return string the generated input field
+ * @see clientChange
+ * @see activeInputField
+ */
+ public static function activeSearchField($model,$attribute,$htmlOptions=array())
+ {
+ self::resolveNameID($model,$attribute,$htmlOptions);
+ self::clientChange('change',$htmlOptions);
+ return self::activeInputField('search',$model,$attribute,$htmlOptions);
+ }
+
+ /**
@resurtm
resurtm Mar 9, 2013

Space indented line.

@resurtm resurtm commented on an outdated diff Mar 9, 2013
framework/web/widgets/CActiveForm.php
@@ -661,6 +661,21 @@ public function textField($model,$attribute,$htmlOptions=array())
}
/**
+ * Renders a text field for a model attribute.
+ * This method is a wrapper of {@link CHtml::activeSearchField}.
+ * Please check {@link CHtml::activeSearchField} for detailed information
+ * about the parameters for this method.
+ * @param CModel $model the data model
+ * @param string $attribute the attribute
+ * @param array $htmlOptions additional HTML attributes.
+ * @return string the generated input field
+ */
+ public function searchField($model,$attribute,$htmlOptions=array())
+ {
+ return CHtml::activeSearchField($model,$attribute,$htmlOptions);
+ }
+
+ /**
@resurtm
resurtm Mar 9, 2013

Space indented line.

@resurtm resurtm was assigned Mar 15, 2013
@resurtm resurtm commented on the diff Mar 15, 2013
framework/web/widgets/CActiveForm.php
@@ -661,6 +661,21 @@ public function textField($model,$attribute,$htmlOptions=array())
}
/**
+ * Renders a search field for a model attribute.
+ * This method is a wrapper of {@link CHtml::activeSearchField}.
+ * Please check {@link CHtml::activeSearchField} for detailed information
+ * about the parameters for this method.
+ * @param CModel $model the data model
+ * @param string $attribute the attribute
+ * @param array $htmlOptions additional HTML attributes.
+ * @return string the generated input field
+ */
@resurtm
resurtm Mar 15, 2013

Please add @since PHPDoc tag. @since 1.1.14 in this case.

@resurtm resurtm commented on the diff Mar 15, 2013
framework/web/helpers/CHtml.php
@@ -1250,11 +1269,11 @@ public static function activeLabelEx($model,$attribute,$htmlOptions=array())
* @see clientChange
* @see activeInputField
*/
@resurtm
resurtm Mar 15, 2013

@since PHPDoc tag required here.

@resurtm resurtm commented on the diff Mar 15, 2013
framework/web/helpers/CHtml.php
@@ -1238,8 +1238,27 @@ public static function activeLabelEx($model,$attribute,$htmlOptions=array())
return self::activeLabel($model,$realAttribute,$htmlOptions);
}
+ /**
@resurtm
resurtm Mar 15, 2013

PHPDoc is still space indented.

@resurtm
resurtm commented Mar 15, 2013

Do not forget to resolve conflicts. (You should pull upstream code into your branch and resolve occurred conflicts yourself.)

@resurtm resurtm added a commit to resurtm/yii that referenced this pull request Mar 20, 2013
@resurtm resurtm Enhancements to the #1980. de416ba
@resurtm resurtm merged commit c2722a4 into yiisoft:master Mar 20, 2013
@resurtm
resurtm commented Mar 20, 2013

Ok, i've merged it: 70190e3...64a6aa8

@njasm, thanks for working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment