/**
  * @inheritdoc
  */
 public function run()
 {
     $view = $this->getView();
     PlacesPluginAsset::register($view);
     $this->varName = "addressPicker" . static::$widgetCounter++;
     $script = implode("\n", [$this->buildAdapter(), $this->buildTypeAhead(), $this->buildEvent()]);
     $view->registerJs($script);
     return $this->hasModel() ? Html::activeTextInput($this->model, $this->attribute, $this->options) : Html::textInput($this->name, $this->value, $this->options);
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     $view = $this->getView();
     $options = $this->encodeOptions();
     $this->varName = $this->generateVarName($options);
     $script = implode("\n", [$this->buildAdapter($options), $this->buildTypeAhead(), $this->buildEvent()]);
     PlacesPluginAsset::register($view);
     $view->registerJs($script);
     if ($this->hasModel()) {
         return Html::activeTextInput($this->model, $this->attribute, $this->options);
     } else {
         return Html::textInput($this->name, $this->value, $this->options);
     }
 }