public function init()
{
parent::init();
if ($this->message === null) {
switch ($this->operator) {
case '==':
$this->message = Yii::t('yii', '{attribute} must be equal to "{compareValueOrAttribute}".');
break;
case '===':
$this->message = Yii::t('yii', '{attribute} must be equal to "{compareValueOrAttribute}".');
break;
case '!=':
$this->message = Yii::t('yii', '{attribute} must not be equal to "{compareValueOrAttribute}".');
break;
case '!==':
$this->message = Yii::t('yii', '{attribute} must not be equal to "{compareValueOrAttribute}".');
break;
case '>':
$this->message = Yii::t('yii', '{attribute} must be greater than "{compareValueOrAttribute}".');
break;
case '>=':
$this->message = Yii::t('yii', '{attribute} must be greater than or equal to "{compareValueOrAttribute}".');
break;
case '<':
$this->message = Yii::t('yii', '{attribute} must be less than "{compareValueOrAttribute}".');
break;
case '<=':
$this->message = Yii::t('yii', '{attribute} must be less than or equal to "{compareValueOrAttribute}".');
break;
default:
throw new InvalidConfigException("Unknown operator: {$this->operator}");
}
}
}