macgyer\yii2materializecss\widgets\form\TimePicker::run PHP Method

run() public method

Executes the widget.
public run ( ) : string
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);
        }
    }