I am using Yii 2.0, I can't figure out how to validate the value of the selected option in the drop-down list, I need to check, if its greater than ZERO.
What i have so far
in the Rules array
['year', 'required'],
['day', 'required'],
['month', 'checkDefaultValue'],...
The custom validate method is
public function checkDefaultValue() {
if ($this->month > 0) {
$this->addError('month', 'Month error message...');
}
}
This code isn't working, is there a better way for doing it?