macgyer\yii2materializecss\widgets\form\DatePicker::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->registerPlugin('pickadate');
        Html::addCssClass($this->options, 'datepicker');
        if ($this->hasModel()) {
            $this->options['data-value'] = isset($this->value) ? $this->value : Html::getAttributeValue($this->model, $this->attribute);
            return Html::activeInput('date', $this->model, $this->attribute, $this->options);
        } else {
            $this->options['data-value'] = $this->value;
            return Html::input('date', $this->name, $this->value, $this->options);
        }
    }
DatePicker