コード例 #1
0
ファイル: ListField.php プロジェクト: frostiks25/rzwebsys7
 /**
  * @inheritdoc
  */
 public function rules()
 {
     $rules = parent::rules();
     if ($this->numeric) {
         $rules[] = [$this->attr, 'integer', 'except' => [ActiveRecord::SCENARIO_SEARCH]];
     }
     if ($this->numeric and $this->defaultValue === null) {
         $rules[] = [$this->attr, 'default', 'value' => 0, 'except' => [ActiveRecord::SCENARIO_SEARCH]];
     }
     return $rules;
 }
コード例 #2
0
ファイル: TextField.php プロジェクト: frostiks25/rzwebsys7
 /**
  * @inheritdoc
  */
 public function rules()
 {
     $rules = parent::rules();
     $rules[] = [$this->attr, 'filter', 'filter' => 'trim'];
     return $rules;
 }
コード例 #3
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     $rules = parent::rules();
     $rules[] = [$this->attr, 'default', 'value' => 0, 'except' => ActiveRecord::SCENARIO_SEARCH];
     return $rules;
 }