Beispiel #1
0
 /**
  * Renders the widget.
  */
 public function run()
 {
     $this->registerClientScript();
     if ($this->hasModel()) {
         $input = Html::activeTextInput($this->model, $this->attribute, $this->options);
     } else {
         $input = Html::textInput($this->name, $this->value, $this->options);
     }
     $route = $this->captchaAction;
     if (is_array($route)) {
         $route['v'] = uniqid();
     } else {
         $route = [$route, 'v' => uniqid()];
     }
     $image = Html::img($route, $this->imageOptions);
     echo strtr($this->template, ['{input}' => $input, '{image}' => $image]);
 }