['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' => '',
],