/** * Renders the filter content * @return string */ public function render() { return DatePicker::widget(ArrayHelper::merge(DatePickerConfig::get($this->getModel(), $this->getAttribute(), ['model' => $this->getModel(), 'attribute' => $this->getAttribute(), 'options' => ['class' => 'form-control', 'placeholder' => \Yii::t('admin/gridview', 'Search')]], DatePicker::class), $this->options)); }
/** * @param array $config * @return static */ public function datePicker($config = []) { if (class_exists('omnilight\\widgets\\DatePicker')) { $defaults = ['options' => ['class' => 'form-control']]; if ($config === []) { try { $config = DatePickerConfig::get($this->model, $this->attribute, [], 'omnilight\\widgets\\DatePicker'); } catch (InvalidParamException $e) { $config = []; } } $config = ArrayHelper::merge($defaults, $config); return $this->widget('omnilight\\widgets\\DatePicker', $config); } return $this->textInput(); }