From 51a4a9ee5151c305c4cb5b6c43e828db7d270449 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Tue, 21 May 2013 16:53:55 +0200 Subject: [PATCH] Apply latest feedback --- yii/bootstrap/TypeAhead.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yii/bootstrap/TypeAhead.php b/yii/bootstrap/TypeAhead.php index 06c6bb5..a2dce0e 100644 --- a/yii/bootstrap/TypeAhead.php +++ b/yii/bootstrap/TypeAhead.php @@ -8,6 +8,7 @@ namespace yii\bootstrap; use Yii; +use yii\base\InvalidConfigException; use yii\base\Model; use yii\helpers\Html; @@ -52,11 +53,15 @@ class TypeAhead extends Widget * @var string the model attribute that this field is associated with */ public $attribute; - /** * @var string the input name. This must be set if [[form]] is not set. */ public $name; + /** + * @var string the input value. + */ + public $value; + /** * Renders the widget @@ -72,20 +77,20 @@ class TypeAhead extends Widget * If [[model]] is null or not from an [[Model]] instance, then the field will be rendered according to * the [[name]] attribute. * @return string the rendering result - * @throws InvalidParamException when none of the required attributes are set to render the textInput. That is, + * @throws InvalidConfigException when none of the required attributes are set to render the textInput. That is, * if [[model]] and [[attribute]] are not set, then [[name]] is required. */ public function renderField() { if ($this->model instanceof Model && $this->attribute !== null) { - $this->options['id'] = $this->id = Html::getInputId($this->model, $this->attribute); + $this->options['id'] = Html::getInputId($this->model, $this->attribute); return Html::activeTextInput($this->model, $this->attribute, $this->options); } if ($this->name === null) { - throw new InvalidParamException( + throw new InvalidConfigException( get_class($this) . ' must specify "form", "model" and "attribute" or "name" property values' ); }