コード例 #1
0
ファイル: StateColumn.php プロジェクト: yariksav/yii2-actives
 public function renderFilterContent()
 {
     if ($this->filter && $this->values) {
         $data = [];
         foreach ($this->values as $key => $value) {
             $data[$key] = $value['title'];
         }
         $this->filter = array('type' => $this->filter, 'data' => $data);
     }
     return parent::renderFilterContent();
 }
コード例 #2
0
ファイル: ColumnMgr.php プロジェクト: yariksav/yii2-actives
 protected function createObject($params)
 {
     if (empty($params['name']) || is_int($params['name'])) {
         throw new \Exception('Please get the name for control');
     }
     if (empty($params['type']) && empty($params['class'])) {
         $params['class'] = Column::className();
     }
     if (isset($params['type'])) {
         $type = $params['type'];
         if (isset(static::$builtInColumns[$type])) {
             $type = static::$builtInColumns[$type];
         }
         if (is_array($type)) {
             $params = array_merge($type, $params);
         } else {
             $params['class'] = $type;
         }
     }
     return Yii::createObject($params, [$this->owner]);
 }
コード例 #3
0
ファイル: DateColumn.php プロジェクト: yariksav/yii2-actives
 public function renderFilterContent()
 {
     $this->filter = ['name' => $this->name, 'type' => 'daterangepicker', 'container' => '.action-bar', 'live' => true, 'data' => ['opens' => 'left', 'startDate' => date($this->dateFormat, $this->filterValue['start']), 'endDate' => date($this->dateFormat, $this->filterValue['end']), 'locale' => ['filter' => 'DD.MM.YYYY h:mm'], 'ranges' => SyDatePicker::dateRanges($this->dateFormat)]];
     return parent::renderFilterContent();
 }