コード例 #1
0
ファイル: DateFilter.php プロジェクト: omnilight/yz2-admin
 /**
  * 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));
 }
コード例 #2
0
ファイル: ActiveField.php プロジェクト: omnilight/yz2-admin
 /**
  * @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();
 }