/** * Executes the widget. * @return string the result of widget execution to be outputted. */ public function run() { $this->registerAssets(); Html::addCssClass($this->options, 'clockpicker'); if ($this->hasModel()) { $this->options['data-value'] = isset($this->value) ? $this->value : Html::getAttributeValue($this->model, $this->attribute); return Html::activeInput('time', $this->model, $this->attribute, $this->options); } else { $this->options['data-value'] = $this->value; return Html::input('time', $this->name, $this->value, $this->options); } }