Commit a5e3e469 by Qiang Xue

Fixes #735: Added back `ActiveField::hiddenInput()`

parent c01ffe7d
...@@ -165,6 +165,7 @@ Yii Framework 2 Change Log ...@@ -165,6 +165,7 @@ Yii Framework 2 Change Log
- Enh: LinkPager can now register relational link tags in the html header for prev, next, first and last page (cebe) - Enh: LinkPager can now register relational link tags in the html header for prev, next, first and last page (cebe)
- Enh: Added `yii\web\UrlRuleInterface` and `yii\web\CompositeUrlRule` (qiangxue) - Enh: Added `yii\web\UrlRuleInterface` and `yii\web\CompositeUrlRule` (qiangxue)
- Enh: Added `yii\web\Request::getAuthUser()` and `getAuthPassword()` (qiangxue) - Enh: Added `yii\web\Request::getAuthUser()` and `getAuthPassword()` (qiangxue)
- Chg #735: Added back `ActiveField::hiddenInput()` (qiangxue)
- Chg #1186: Changed `Sort` to use comma to separate multiple sort fields and use negative sign to indicate descending sort (qiangxue) - Chg #1186: Changed `Sort` to use comma to separate multiple sort fields and use negative sign to indicate descending sort (qiangxue)
- Chg #1519: `yii\web\User::loginRequired()` now returns the `Response` object instead of exiting the application (qiangxue) - Chg #1519: `yii\web\User::loginRequired()` now returns the `Response` object instead of exiting the application (qiangxue)
- Chg #1564: Removed `yii\web\Session::autoStart` and added `hasSessionId`. Session will be automatically started when accessing session data (qiangxue) - Chg #1564: Removed `yii\web\Session::autoStart` and added `hasSessionId`. Session will be automatically started when accessing session data (qiangxue)
......
...@@ -312,6 +312,27 @@ class ActiveField extends Component ...@@ -312,6 +312,27 @@ class ActiveField extends Component
} }
/** /**
* Renders a hidden input.
*
* Note that this method is provided for completeness. In most cases because you do not need
* to validate a hidden input, you should not need to use this method. Instead, you should
* use [[\yii\helpers\Html::activeHiddenInput()]].
*
* This method will generate the "name" and "value" tag attributes automatically for the model attribute
* unless they are explicitly specified in `$options`.
* @param array $options the tag options in terms of name-value pairs. These will be rendered as
* the attributes of the resulting tag. The values will be HTML-encoded using [[Html::encode()]].
* @return static the field object itself
*/
public function hiddenInput($options = [])
{
$options = array_merge($this->inputOptions, $options);
$this->adjustLabelFor($options);
$this->parts['{input}'] = Html::activeHiddenInput($this->model, $this->attribute, $options);
return $this;
}
/**
* Renders a password input. * Renders a password input.
* This method will generate the "name" and "value" tag attributes automatically for the model attribute * This method will generate the "name" and "value" tag attributes automatically for the model attribute
* unless they are explicitly specified in `$options`. * unless they are explicitly specified in `$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