public function rules() { [['is_property_owner', 'is_property_renant'], 'validateproperty'], } public function validateproperty($attribute, $params){ if(empty($this->is_property_owner) && empty($this->is_property_renant)){ $this->addError('is_property_renant', 'Please select at least one option.'); } }
Friday, November 18, 2016
yii2 custom validator multiple attributes
Labels:
validation,
validator,
yii2
Location:
Dhaka, Bangladesh
yii2 custom validator multiple attributes
public function rules() { [['is_property_owner', 'is_property_renant'], 'validateproperty'], } public function validateproperty($attribute, $params){ if(empty($this->is_property_owner) && empty($this->is_property_renant)){ $this->addError('is_property_renant', 'Please select at least one option.'); } }
Labels:
validation,
validator,
yii2
Location:
Dhaka, Bangladesh
Subscribe to:
Posts (Atom)