['proj_1st_id', 'check'],
public function check($attribute, $params){ if(!$this->hasErrors()){ if($this->position == 1 && empty($this->proj_1st_id)){ $this->addError($attribute,'位置为一级项目轮播图时,一级项目为必填'); } } }
[ ['href'], 'required', 'when' => function($model) { return $model->link_type == 1; }, 'whenClient' => "function(attribute, value) { return $('#banner-link_type').val() == '1'; }", // 'on' => '', ],